Merge with 5c0d84b4b50732776e41a30c15cc21a2615b1a86
This commit is contained in:
commit
09397e24a6
|
@ -1,55 +1,71 @@
|
|||
CREATE OR REPLACE PROCEDURE nextID
|
||||
(
|
||||
p_AD_Sequence_ID IN NUMBER,
|
||||
p_System IN CHAR,
|
||||
o_NextID OUT NUMBER
|
||||
)
|
||||
/*************************************************************************
|
||||
* The contents of this file are subject to the Adempiere License. You may
|
||||
* obtain a copy of the License at http://www.adempiere.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: Adempiere ERP+CRM
|
||||
* Copyright (C) 1999-2005 Jorg Janke, ComPiere, Inc. All Rights Reserved.
|
||||
*************************************************************************
|
||||
* $Id: nextID.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
|
||||
***
|
||||
* Title: Get Next ID - no Commit
|
||||
* Description:
|
||||
* Test via
|
||||
DECLARE
|
||||
v_NextID NUMBER;
|
||||
BEGIN
|
||||
nextID(2, 'Y', v_NextID);
|
||||
DBMS_OUTPUT.PUT_LINE(v_NextID);
|
||||
END;
|
||||
*
|
||||
************************************************************************/
|
||||
AS
|
||||
BEGIN
|
||||
IF (p_System = 'Y') THEN
|
||||
SELECT CurrentNextSys
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID
|
||||
FOR UPDATE OF CurrentNextSys;
|
||||
--
|
||||
UPDATE AD_Sequence
|
||||
SET CurrentNextSys = CurrentNextSys + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
ELSE
|
||||
SELECT CurrentNext
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID
|
||||
FOR UPDATE OF CurrentNext;
|
||||
--
|
||||
UPDATE AD_Sequence
|
||||
SET CurrentNext = CurrentNext + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
END IF;
|
||||
--
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
DBMS_OUTPUT.PUT_LINE(SQLERRM);
|
||||
END nextID;
|
||||
/
|
||||
CREATE OR REPLACE PROCEDURE nextID
|
||||
(
|
||||
p_AD_Sequence_ID IN NUMBER,
|
||||
p_System IN CHAR,
|
||||
o_NextID OUT NUMBER
|
||||
)
|
||||
/*************************************************************************
|
||||
* The contents of this file are subject to the Adempiere License. You may
|
||||
* obtain a copy of the License at http://www.adempiere.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: Adempiere ERP+CRM
|
||||
* Copyright (C) 1999-2005 Jorg Janke, ComPiere, Inc. All Rights Reserved.
|
||||
*************************************************************************
|
||||
* $Id: nextID.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
|
||||
***
|
||||
* Title: Get Next ID - no Commit
|
||||
* Description:
|
||||
* Test via
|
||||
*
|
||||
************************************************************************/
|
||||
AS
|
||||
Isnativeseqon NVARCHAR2(1);
|
||||
Tablename Nvarchar2(60);
|
||||
sqlcmd VARCHAR2(200);
|
||||
BEGIN
|
||||
|
||||
|
||||
IF (p_System = 'Y') THEN
|
||||
SELECT CurrentNextSys
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID
|
||||
FOR UPDATE OF CurrentNextSys;
|
||||
--
|
||||
UPDATE AD_Sequence
|
||||
SET CurrentNextSys = CurrentNextSys + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
ELSE
|
||||
|
||||
Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0);
|
||||
IF Isnativeseqon = 'Y' THEN
|
||||
|
||||
SELECT Name
|
||||
INTO tablename
|
||||
FROM Ad_Sequence
|
||||
WHERE Ad_Sequence_Id=P_Ad_Sequence_Id;
|
||||
--
|
||||
Sqlcmd := 'SELECT '||Tablename||'_SQ.Nextval FROM DUAL';
|
||||
--
|
||||
Execute Immediate Sqlcmd Into O_Nextid;
|
||||
--
|
||||
ELSE
|
||||
|
||||
SELECT CurrentNext
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID
|
||||
FOR UPDATE OF CurrentNext;
|
||||
--
|
||||
UPDATE Ad_Sequence
|
||||
SET Currentnext = Currentnext + Incrementno
|
||||
WHERE Ad_Sequence_Id=P_Ad_Sequence_Id;
|
||||
--
|
||||
END IF;
|
||||
END IF;
|
||||
--
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
DBMS_OUTPUT.PUT_LINE(SQLERRM);
|
||||
END nextID;
|
||||
/
|
||||
|
|
|
@ -21,7 +21,9 @@ CREATE OR REPLACE FUNCTION nextid(
|
|||
* select * from nextid((select ad_sequence_id from ad_sequence where name = 'Test')::Integer, 'Y'::Varchar);
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
DECLARE
|
||||
Isnativeseqon VARCHAR(1);
|
||||
tablename VARCHAR(60);
|
||||
BEGIN
|
||||
IF (p_System = 'Y') THEN
|
||||
RAISE NOTICE 'system';
|
||||
|
@ -34,14 +36,26 @@ BEGIN
|
|||
SET CurrentNextSys = CurrentNextSys + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
ELSE
|
||||
SELECT CurrentNext
|
||||
|
||||
Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0);
|
||||
IF Isnativeseqon = 'Y' THEN
|
||||
SELECT Name
|
||||
INTO tablename
|
||||
FROM Ad_Sequence
|
||||
WHERE Ad_Sequence_Id=P_Ad_Sequence_Id;
|
||||
--
|
||||
EXECUTE 'SELECT nextval('''||tablename||'_sq'''||')' INTO o_NextID;
|
||||
--
|
||||
ELSE
|
||||
SELECT CurrentNext
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
--
|
||||
UPDATE AD_Sequence
|
||||
SET CurrentNext = CurrentNext + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
--
|
||||
UPDATE AD_Sequence
|
||||
SET CurrentNext = CurrentNext + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
END IF;
|
||||
END IF;
|
||||
--
|
||||
EXCEPTION
|
||||
|
@ -51,5 +65,3 @@ END;
|
|||
|
||||
$body$ LANGUAGE plpgsql;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,368 @@
|
|||
-- Sep 4, 2012 10:34:50 AM COT
|
||||
-- Element Master Role
|
||||
INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsMasterRole',200117,'D','MasterRole','MasterRole','4bad6035-f81b-4e25-81d9-bbf55b099113',0,TO_DATE('2012-09-04 10:34:49','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-04 10:34:49','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y')
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:34:50 AM COT
|
||||
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200117 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:36:19 AM COT
|
||||
-- Column master Role
|
||||
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection,DefaultValue) VALUES (0,156,200410,'D','Y','N','N',0,'N',1,'N',20,'N','N',200117,'N','Y','5ec60b3e-f1a7-447c-a7ea-f3575dcb24d4','N','Y','N','IsMasterRole','MasterRole','Y',100,TO_DATE('2012-09-04 10:36:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-09-04 10:36:18','YYYY-MM-DD HH24:MI:SS'),100,0,0,'N')
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:36:19 AM COT
|
||||
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200410 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
|
||||
;
|
||||
|
||||
|
||||
-- Sep 4, 2012 10:37:58 AM COT
|
||||
-- Field Master Role
|
||||
INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',119,1,'N','N',200410,'Y',200411,'N','D','MasterRole','Y','N','b57a3894-98be-44fa-a834-6883c8824d92',100,0,TO_DATE('2012-09-04 10:37:58','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-09-04 10:37:58','YYYY-MM-DD HH24:MI:SS'),'Y')
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:37:58 AM COT
|
||||
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200411 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:38:27 AM COT
|
||||
-- seq
|
||||
UPDATE AD_Field SET SeqNo=440,IsDisplayed='Y' WHERE AD_Field_ID=200411
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:38:40 AM COT
|
||||
-- Position web
|
||||
UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-09-04 10:38:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200411
|
||||
;
|
||||
|
||||
|
||||
-- Sep 4, 2012 4:12:10 PM COT
|
||||
-- Validation for just Master Role in included roles
|
||||
INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Client_ID,IsActive,AD_Org_ID) VALUES ('AD_Role.IsMasterRole=''Y''',200006,'D','MasterRoles','S','5d5fa599-0937-4e88-905b-b0814fc7fc84',100,100,TO_DATE('2012-09-04 16:12:08','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-04 16:12:08','YYYY-MM-DD HH24:MI:SS'),0,'Y',0)
|
||||
;
|
||||
|
||||
|
||||
-- Sep 4, 2012 4:13:06 PM COT
|
||||
UPDATE AD_Column SET AD_Val_Rule_ID=200006, IsUpdateable='N',Updated=TO_DATE('2012-09-04 16:13:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=57949
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 4:55:32 PM COT
|
||||
-- Display Logic Window Role
|
||||
UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-04 16:55:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=351
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 4:55:40 PM COT
|
||||
-- Display Logic Window Role
|
||||
UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-04 16:55:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=120
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 4:55:53 PM COT
|
||||
-- Display Logic Window Role
|
||||
UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-04 16:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53240
|
||||
;
|
||||
|
||||
-- Sep 5, 2012 2:26:43 PM COT
|
||||
-- Roles are manual for default
|
||||
UPDATE AD_Column SET DefaultValue='Y',Updated=TO_DATE('2012-09-05 14:26:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=9593
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 6:56:24 PM COT
|
||||
ALTER TABLE AD_Role ADD IsMasterRole CHAR(1) DEFAULT 'N' CHECK (IsMasterRole IN ('Y','N')) NOT NULL
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 6:56:46 PM COT
|
||||
ALTER TABLE AD_Role MODIFY IsManual CHAR(1) DEFAULT 'Y'
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200411
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=930
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=931
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=59592
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=59591
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=10126
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=52018
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=8740
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=5227
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=11006
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=11003
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=11002
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=8311
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=10813
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=11256
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=11257
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=8313
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=8314
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=8312
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=8310
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=12367
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=12368
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=12641
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=200071
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=50168
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=50169
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=50170
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=50171
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=50172
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=50173
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=50174
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=50175
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=50176
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=50177
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:23 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=50178
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:23 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=430,IsDisplayed='Y' WHERE AD_Field_ID=55432
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:23 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=440,IsDisplayed='Y' WHERE AD_Field_ID=55433
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Element SET Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', PrintName='Master Role',Updated=TO_DATE('2012-09-11 20:43:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200117
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200117
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Column SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Element_ID=200117
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Process_Para SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL, AD_Element_ID=200117 WHERE UPPER(ColumnName)='ISMASTERROLE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Process_Para SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Element_ID=200117 AND IsCentrallyMaintained='Y'
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200117) AND IsCentrallyMaintained='Y'
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_PrintFormatItem pi SET PrintName='Master Role', Name='Master Role' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=200117)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 10:48:11 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLJ'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-11 22:48:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=102
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:38:13 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:38:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124
|
||||
;
|
||||
|
||||
|
||||
-- Sep 12, 2012 11:40:18 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:40:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=121
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:41:16 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:41:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=173
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:41:30 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:41:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:41:39 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:41:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52054
|
||||
;
|
||||
|
||||
|
||||
-- Sep 12, 2012 11:41:55 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:41:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:42:02 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:42:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=201
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:42:08 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:42:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52004
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:42:16 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_DATE('2012-09-12 11:42:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066
|
||||
;
|
||||
|
||||
|
||||
-- Sep 12, 2012 6:20:08 PM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-12 18:20:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209
|
||||
;
|
||||
|
||||
|
||||
-- Sep 12, 2012 6:28:44 PM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARR'', ''APP'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-12 18:28:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=149
|
||||
;
|
||||
|
||||
|
||||
UPDATE AD_System
|
||||
SET LastMigrationScriptApplied='899_IDEMPIERE_366.sql'
|
||||
WHERE LastMigrationScriptApplied<'899_IDEMPIERE_366.sql'
|
||||
OR LastMigrationScriptApplied IS NULL
|
||||
;
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
-- Sep 11, 2012 8:42:54 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Invoice Processed: ',200060,'U','3c06a457-be2c-4e54-a197-ac5b5646143f','InvoiceProcessed','Y',TO_DATE('2012-09-11 20:42:53','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 20:42:53','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:42:55 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200060 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:49:40 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Payment Allocated: ',200061,'U','2d9d4e87-b308-4643-9046-a2730a95cb9b','PaymentAllocated','Y',TO_DATE('2012-09-11 20:49:39','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 20:49:39','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:49:40 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200061 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:52:47 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Allocation Processed: ',200062,'U','5e6e24fc-a609-4424-9aa4-f30f13fa03ac','AllocationProcessed','Y',TO_DATE('2012-09-11 20:52:46','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 20:52:46','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:52:47 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200062 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:54:59 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Shipment Processed: ',200063,'U','1de82564-7da4-468e-955d-7451a304844d','ShipmentProcessed','Y',TO_DATE('2012-09-11 20:54:58','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 20:54:58','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:54:59 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200063 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 9:00:52 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Order Created: ',200064,'U','0e54bec9-9529-4ac8-b453-b36b201b5149','OrderCreated','Y',TO_DATE('2012-09-11 21:00:51','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 21:00:51','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 9:00:52 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200064 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 9:05:34 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Generated PO: ',200065,'U','f0135f4a-27e6-499c-9c7e-851631a10a4f','GeneratedPO','Y',TO_DATE('2012-09-11 21:05:33','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-11 21:05:33','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 9:05:34 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200065 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
SELECT register_migration_script('908_Process_Message.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,36 @@
|
|||
-- Sep 12, 2012 6:56:41 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
INSERT INTO AD_SysConfig (AD_SysConfig_ID,EntityType,ConfigurationLevel,Value,Description,AD_SysConfig_UU,Created,Updated,AD_Client_ID,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name) VALUES (200020,'D','S','Y','New password must differs from the old password','13b5a576-7b91-471b-8b40-05589dd585f7',TO_DATE('2012-09-12 18:56:39','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-12 18:56:39','YYYY-MM-DD HH24:MI:SS'),0,0,100,'Y',100,'CHANGE_PASSWORD_MUST_DIFFER')
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:57:05 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
UPDATE AD_Column SET FieldLength=1024,Updated=TO_DATE('2012-09-12 18:57:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200457
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:57:13 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
ALTER TABLE AD_User MODIFY SecurityQuestion NVARCHAR2(1024) DEFAULT NULL
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:58:41 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','New Password must differ from Old Password',200066,'U','0d873a03-0980-4725-8a4f-a6954e4ee59e','NewPasswordMustDiffer','Y',TO_DATE('2012-09-12 18:58:40','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-12 18:58:40','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:58:41 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200066 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:58:45 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
UPDATE AD_Message SET EntityType='D',Updated=TO_DATE('2012-09-12 18:58:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200066
|
||||
;
|
||||
|
||||
UPDATE AD_User u SET SecurityQuestion = (
|
||||
SELECT MAX(m.MsgText) FROM AD_Message m WHERE m.Value = u.SecurityQuestion)
|
||||
WHERE u.SecurityQuestion IS NOT NULL;
|
||||
|
||||
SELECT register_migration_script('910_IDEMPIERE-375.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,36 @@
|
|||
-- Sep 17, 2012 5:24:55 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:24:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=124
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:09 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=121
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:14 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=173
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:30 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52054
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:38 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=125
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:44 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=201
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:49 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:25:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52004
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:26:19 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_DATE('2012-09-17 17:26:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52066
|
||||
;
|
||||
|
||||
SELECT register_migration_script('911_IDEMPIERE-366.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,202 @@
|
|||
-- Sep 18, 2012 2:38:36 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Form (AccessLevel,Classname,AD_Form_ID,Help,IsBetaFunctionality,EntityType,AD_Form_UU,Description,Name,AD_Org_ID,UpdatedBy,CreatedBy,Updated,Created,AD_Client_ID,IsActive) VALUES ('1','org.compiere.apps.form.VResetPassword',200001,NULL,'N','D','e2db983d-c11a-46f7-a4f5-fca8167c8d6c','Reset Password','Reset Password',0,100,100,TO_DATE('2012-09-18 14:38:34','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-09-18 14:38:34','YYYY-MM-DD HH24:MI:SS'),0,'Y')
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:38:38 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Form_Trl (AD_Language,AD_Form_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Form_Trl_UU ) SELECT l.AD_Language,t.AD_Form_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Form t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Form_ID=200001 AND NOT EXISTS (SELECT * FROM AD_Form_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Form_ID=t.AD_Form_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:13 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Menu (AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,AD_Form_ID,EntityType,IsCentrallyMaintained,Name,Description,Action,AD_Menu_UU,IsActive,AD_Client_ID,CreatedBy,Updated,AD_Org_ID,Created,UpdatedBy) VALUES (200017,'N','N','N',200001,'D','Y','Reset Password','Reset Passwords for User','X','c9aa4c76-894d-4a72-97de-38d0345fd477','Y',0,100,TO_DATE('2012-09-18 14:39:12','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2012-09-18 14:39:12','YYYY-MM-DD HH24:MI:SS'),100)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:14 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Menu_Trl_UU ) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200017 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:14 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 100, SysDate, 100,t.AD_Tree_ID, 200017, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200017)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200002
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=147
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53246
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200017
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=487
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200012
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=150
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=495
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=50007
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=362
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=200001
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=475
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=366
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=483
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=368
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=508
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53348
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:32 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
DELETE FROM AD_Menu_Trl WHERE AD_Menu_ID=487
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:33 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
DELETE FROM AD_Menu WHERE AD_Menu_ID=487
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:33 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
DELETE FROM AD_TreeNodeMM n WHERE Node_ID=487 AND EXISTS (SELECT * FROM AD_Tree t WHERE t.AD_Tree_ID=n.AD_Tree_ID AND t.TreeType='MM')
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:48:49 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_Form SET AccessLevel='7',Updated=TO_DATE('2012-09-18 14:48:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Form_ID=200001
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:32:53 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','User is Mandatory',NULL,200067,'D','40544a9e-776d-4f96-8ef1-f38de2237027','UserMandatory','Y',TO_DATE('2012-09-18 16:32:51','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:32:51','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:32:53 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200067 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:35:14 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','New EMail does not match the Confirm New EMail',200068,'D','5046c7a0-0846-4f09-b130-d8280a043775','NewEmailNotMatch','Y',TO_DATE('2012-09-18 16:35:13','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:35:13','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:35:14 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200068 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:35:51 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Confirm New EMail is Mandatory',200069,'D','c9e44d6f-af2e-4306-bb84-2df8258ad79c','NewEmailConfirmMandatory','Y',TO_DATE('2012-09-18 16:35:50','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:35:50','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:35:51 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200069 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:37:44 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Confirm New EMail',200070,'D','41282b1f-672c-43e0-b823-439b87fa0544','New EMail Confirm','Y',TO_DATE('2012-09-18 16:37:43','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:37:43','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:37:44 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200070 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:38:20 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail',200071,'D','6a228718-3a23-46d3-8e0c-97a6511acc50','New EMail','Y',TO_DATE('2012-09-18 16:38:19','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:38:19','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:38:20 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200071 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:38:36 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail User',200072,'D','3bf5a60b-20a1-484d-a5f0-11dbe95fcbce','New EMail User','Y',TO_DATE('2012-09-18 16:38:35','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:38:35','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:38:36 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200072 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:39:03 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail User Password',200073,'D','cfe2fcb8-81cc-4df5-b187-f1df99f8f842','New EMail User Password','Y',TO_DATE('2012-09-18 16:38:59','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-09-18 16:38:59','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:39:03 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200073 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
SELECT register_migration_script('913_IDEMPIERE-374.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,742 @@
|
|||
-- Sep 17, 2012 5:20:18 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:20:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=295
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:20:26 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:20:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=226
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:20:57 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:20:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=300
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:21:11 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:21:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=231
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:23:52 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:23:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=499
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:23:57 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-17 17:23:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=308
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:24:38 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:24:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53090
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:24:44 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-17 17:24:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53070
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:24:44 PM COT
|
||||
UPDATE AD_Menu SET Name='Prepare Migration Scripts', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-17 17:24:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53090
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:24:44 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53090
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:38 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:25:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=448
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:42 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:25:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=317
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:26:20 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:26:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=449
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:26:25 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:26:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=316
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:35:04 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=310
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:35:04 PM COT
|
||||
UPDATE AD_Menu SET Name='Auction Buyer', Description='Maintain Auction Buyer Information', IsActive='N',Updated=TO_DATE('2012-09-17 17:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=442
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:39:52 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=309
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:39:52 PM COT
|
||||
UPDATE AD_Menu SET Name='Auction Seller', Description='Maintain Auction Seller Information', IsActive='N',Updated=TO_DATE('2012-09-17 17:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=443
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:40:54 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:40:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=447
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:41:00 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:41:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=307
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:41:52 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:41:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=453
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:41:56 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:41:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=308
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:45:35 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:45:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52000
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:46:02 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-17 17:46:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=52003
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:46:02 PM COT
|
||||
UPDATE AD_Menu SET Name='Update Role Menu', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-17 17:46:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52000
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:46:02 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=52000
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:51:42 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:51:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52002
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:51:51 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:51:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52000
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:58:52 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:58:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52003
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:58:57 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:58:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52001
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:59:52 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 17:59:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52004
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:59:59 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 17:59:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52002
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:00:47 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 18:00:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52005
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:00:52 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 18:00:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52003
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:01:46 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 18:01:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53013
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:01:51 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-17 18:01:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53002
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:01:51 PM COT
|
||||
UPDATE AD_Menu SET Name='Setup Web POS', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-17 18:01:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53013
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:01:51 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53013
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:02:44 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-17 18:02:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53196
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:02:49 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-17 18:02:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53065
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:02:49 PM COT
|
||||
UPDATE AD_Menu SET Name='Web POS Terminal', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-17 18:02:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53196
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:02:49 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53196
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:17:00 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 14:17:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=392
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:17:59 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 14:17:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=389
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:18:04 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 14:18:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=287
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:18:55 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 14:18:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=390
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:19:00 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 14:19:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=290
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:29:19 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:29:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=391
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:29:29 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:29:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=289
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:30:50 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:30:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=590
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:30:55 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=386
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:31:26 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:31:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=591
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:31:30 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:31:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=387
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:32:23 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:32:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=592
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:32:27 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:32:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=388
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:34:02 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:34:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=593
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:34:09 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 17:34:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=350
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:34:09 PM COT
|
||||
UPDATE AD_Menu SET Name='Rebuild Index', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-18 17:34:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=593
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:34:09 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=593
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:52:15 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:52:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=573
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:52:20 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:52:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=379
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:53:08 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:53:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=574
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:53:14 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=376
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:54:07 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:54:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=576
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:54:11 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:54:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=375
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:58:59 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:58:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=579
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:59:05 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 17:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=373
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:59:45 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 17:59:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=584
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:59:50 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 17:59:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=345
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:00:23 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:00:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=587
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:00:28 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:00:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=383
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:01:07 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:01:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=588
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:01:11 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:01:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=384
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:07:03 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:07:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52001
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:07:49 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:07:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=460
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:10:10 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53264
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:10:15 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53109
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:10:15 PM COT
|
||||
UPDATE AD_Menu SET Name='Import Product Planning', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-18 18:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53264
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:10:15 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53264
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:17:14 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:17:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=371
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:17:19 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:17:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=269
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:20:15 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:20:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=375
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:20:19 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:20:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=273
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:20:50 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:20:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=380
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:20:56 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:20:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=274
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:21:33 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:21:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=415
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:21:37 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:21:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=239
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:22:07 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:22:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=416
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:22:16 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:22:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=240
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:22:37 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:22:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=372
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:23:27 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:23:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=559
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:23:31 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:23:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=367
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:24:03 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:24:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=560
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:24:07 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:24:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=368
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:24:45 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:24:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=561
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:24:49 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:24:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=369
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:25:23 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:25:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=562
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:25:27 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:25:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=370
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:26:03 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:26:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=563
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:26:08 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:26:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=371
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:26:54 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:26:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=564
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:26:59 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:26:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=372
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:31:03 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:31:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=488
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:31:07 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:31:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=335
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:31:49 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:31:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=489
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:31:53 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:31:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=336
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:32:54 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:32:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=241
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:32:59 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=198
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:35:18 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:35:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=288
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:35:24 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:35:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=170
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:36:45 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:36:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53132
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:36:50 PM COT
|
||||
UPDATE AD_Form SET IsActive='N',Updated=TO_DATE('2012-09-18 18:36:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Form_ID=53010
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:39:43 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:39:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=187
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:39:49 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:39:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=175
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:40:25 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:40:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=358
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:40:31 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:40:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=261
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:41:15 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=477
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:41:19 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:41:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=329
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:42:01 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:42:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=504
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:42:05 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=311
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:42:46 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:42:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=360
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:42:52 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:42:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=262
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:43:26 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:43:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=498
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:43:32 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=340
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:44:09 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:44:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=532
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:44:12 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:44:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=353
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:08 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:45:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53187
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:11 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_DATE('2012-09-18 18:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53152
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:11 PM COT
|
||||
UPDATE AD_Menu SET Name='Immediate Bank Transfer', Description=NULL, IsActive='N',Updated=TO_DATE('2012-09-18 18:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53187
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:11 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53187
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:48 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:45:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53256
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:53 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:45:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53104
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:46:37 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:46:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=173
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:46:43 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:46:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=160
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:47:44 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:47:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=284
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:47:48 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:47:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=220
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:48:25 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=344
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:48:30 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:48:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=253
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:51:14 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:51:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=547
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:51:19 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:51:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=359
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:51:50 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:51:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=550
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:51:54 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:51:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=361
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:52:26 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:52:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=551
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:52:30 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-18 18:52:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=362
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:55:48 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-18 18:55:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53169
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:29:42 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:29:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54416
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:37:37 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:37:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=9286
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:21 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11517
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:38 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11520
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:44 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11521
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:48 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11519
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:53 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11516
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:56 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:41:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11518
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:42:05 AM COT
|
||||
UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-09-19 10:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=707
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:29 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1494
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:36 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2074
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:41 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1597
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:45 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1492
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:49 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1495
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:56 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:43:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2611
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:44:00 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:44:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2612
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:44:08 AM COT
|
||||
UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-09-19 10:44:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=214
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:50:54 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-19 10:50:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=12360
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:52:39 AM COT
|
||||
UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_DATE('2012-09-19 10:52:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=229
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:52:56 AM COT
|
||||
UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_DATE('2012-09-19 10:52:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=312
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:53:44 AM COT
|
||||
UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_DATE('2012-09-19 10:53:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53015
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:54:05 AM COT
|
||||
UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_DATE('2012-09-19 10:54:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53016
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:12:15 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 18:12:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=288
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:12:15 PM COT
|
||||
UPDATE AD_Menu SET Name='Knowledge Base', Description='Maintain Knowledge Base', IsActive='N',Updated=TO_DATE('2012-09-20 18:12:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=388
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:13:16 PM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-20 18:13:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=55432
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:13:24 PM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-20 18:13:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=55433
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:13:44 PM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-20 18:13:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50171
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:14:47 PM COT
|
||||
UPDATE AD_Column SET DefaultValue='N',Updated=TO_DATE('2012-09-20 18:14:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50201
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:14:51 PM COT
|
||||
UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 18:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50201
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:15 PM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-20 18:15:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50171
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:24 PM COT
|
||||
UPDATE AD_Column SET DefaultValue='N',Updated=TO_DATE('2012-09-20 18:15:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55333
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:26 PM COT
|
||||
UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 18:15:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55333
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:38 PM COT
|
||||
UPDATE AD_Column SET DefaultValue='N',Updated=TO_DATE('2012-09-20 18:15:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55332
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:41 PM COT
|
||||
UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-09-20 18:15:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55332
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:16:02 PM COT
|
||||
ALTER TABLE AD_Role MODIFY Allow_Info_MRP CHAR(1) DEFAULT 'N'
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:16:03 PM COT
|
||||
UPDATE AD_Role SET Allow_Info_MRP='N' WHERE Allow_Info_MRP IS NULL
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:16:33 PM COT
|
||||
ALTER TABLE AD_Role MODIFY Allow_Info_CRP CHAR(1) DEFAULT 'N'
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:16:34 PM COT
|
||||
UPDATE AD_Role SET Allow_Info_CRP='N' WHERE Allow_Info_CRP IS NULL
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:17:03 PM COT
|
||||
ALTER TABLE AD_Role MODIFY Allow_Info_CashJournal CHAR(1) DEFAULT 'N'
|
||||
;
|
||||
|
||||
UPDATE AD_Role SET Allow_Info_CashJournal='N', Allow_Info_MRP='N', Allow_Info_CRP='N'
|
||||
;
|
||||
|
||||
SELECT register_migration_script('914_IDEMPIERE-362.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,259 @@
|
|||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
-- Sep 19, 2012 4:36:27 PM COT
|
||||
UPDATE AD_Column SET IsActive='N' WHERE AD_Column_ID IN (
|
||||
4862, -- C_AcctSchema_Default.B_Expense_Acct
|
||||
4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct
|
||||
4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct
|
||||
4866, -- C_AcctSchema_Default.B_SettlementGain_Acct
|
||||
4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct
|
||||
4865, -- C_AcctSchema_Default.B_Unidentified_Acct
|
||||
3449, -- C_AcctSchema_Default.E_Expense_Acct
|
||||
3450, -- C_AcctSchema_Default.E_Prepayment_Acct
|
||||
4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct
|
||||
4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct
|
||||
56545, -- C_AcctSchema_Default.P_Burden_Acct
|
||||
56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct
|
||||
56542, -- C_AcctSchema_Default.P_FloorStock_Acct
|
||||
56544, -- C_AcctSchema_Default.P_Labor_Acct
|
||||
56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct
|
||||
56541, -- C_AcctSchema_Default.P_MixVariance_Acct
|
||||
56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct
|
||||
56567, -- C_AcctSchema_Default.P_Overhead_Acct
|
||||
56568, -- C_AcctSchema_Default.P_Scrap_Acct
|
||||
56539, -- C_AcctSchema_Default.P_UsageVariance_Acct
|
||||
56537, -- C_AcctSchema_Default.P_WIP_Acct
|
||||
4856, -- C_AcctSchema_Default.T_Liability_Acct
|
||||
4857, -- C_AcctSchema_Default.T_Receivables_Acct
|
||||
6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct
|
||||
3443, -- C_AcctSchema_Default.W_Inventory_Acct
|
||||
4853, -- C_AcctSchema_Default.Withholding_Acct
|
||||
4843, -- C_AcctSchema_Default.W_Revaluation_Acct
|
||||
2501, -- C_AcctSchema_GL.IncomeSummary_Acct
|
||||
2500, -- C_AcctSchema_GL.RetainedEarning_Acct
|
||||
2493, -- C_AcctSchema_GL.SuspenseError_Acct
|
||||
4901, -- C_BankAccount_Acct.B_Expense_Acct
|
||||
4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct
|
||||
4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct
|
||||
4905, -- C_BankAccount_Acct.B_SettlementGain_Acct
|
||||
4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct
|
||||
4904, -- C_BankAccount_Acct.B_Unidentified_Acct
|
||||
3381, -- C_BP_Employee_Acct.E_Expense_Acct
|
||||
3382, -- C_BP_Employee_Acct.E_Prepayment_Acct
|
||||
4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct
|
||||
4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct
|
||||
10287, -- C_Currency_Acct.RealizedGain_Acct
|
||||
10289, -- C_Currency_Acct.RealizedLoss_Acct
|
||||
10279, -- C_Currency_Acct.UnrealizedGain_Acct
|
||||
10290, -- C_Currency_Acct.UnrealizedLoss_Acct
|
||||
5085, -- C_Tax_Acct.T_Liability_Acct
|
||||
5087, -- C_Tax_Acct.T_Receivables_Acct
|
||||
56565, -- M_Product_Acct.P_Burden_Acct
|
||||
56563, -- M_Product_Acct.P_CostOfProduction_Acct
|
||||
56562, -- M_Product_Acct.P_FloorStock_Acct
|
||||
56564, -- M_Product_Acct.P_Labor_Acct
|
||||
56558, -- M_Product_Acct.P_MethodChangeVariance_Acct
|
||||
56561, -- M_Product_Acct.P_MixVariance_Acct
|
||||
56566, -- M_Product_Acct.P_OutsideProcessing_Acct
|
||||
56571, -- M_Product_Acct.P_Overhead_Acct
|
||||
56572, -- M_Product_Acct.P_Scrap_Acct
|
||||
56559, -- M_Product_Acct.P_UsageVariance_Acct
|
||||
56557, -- M_Product_Acct.P_WIP_Acct
|
||||
56555, -- M_Product_Category_Acct.P_Burden_Acct
|
||||
56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct
|
||||
56547, -- M_Product_Category_Acct.P_FloorStock_Acct
|
||||
56554, -- M_Product_Category_Acct.P_Labor_Acct
|
||||
56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct
|
||||
56552, -- M_Product_Category_Acct.P_MixVariance_Acct
|
||||
56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct
|
||||
56569, -- M_Product_Category_Acct.P_Overhead_Acct
|
||||
56570, -- M_Product_Category_Acct.P_Scrap_Acct
|
||||
56550, -- M_Product_Category_Acct.P_UsageVariance_Acct
|
||||
56548, -- M_Product_Category_Acct.P_WIP_Acct
|
||||
6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct
|
||||
3386, -- M_Warehouse_Acct.W_Inventory_Acct
|
||||
5133 -- M_Warehouse_Acct.W_Revaluation_Acct
|
||||
)
|
||||
;
|
||||
|
||||
|
||||
|
||||
--
|
||||
|
||||
UPDATE AD_Field SET IsActive='N' WHERE AD_Column_ID IN (
|
||||
4862, -- C_AcctSchema_Default.B_Expense_Acct
|
||||
4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct
|
||||
4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct
|
||||
4866, -- C_AcctSchema_Default.B_SettlementGain_Acct
|
||||
4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct
|
||||
4865, -- C_AcctSchema_Default.B_Unidentified_Acct
|
||||
3449, -- C_AcctSchema_Default.E_Expense_Acct
|
||||
3450, -- C_AcctSchema_Default.E_Prepayment_Acct
|
||||
4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct
|
||||
4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct
|
||||
56545, -- C_AcctSchema_Default.P_Burden_Acct
|
||||
56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct
|
||||
56542, -- C_AcctSchema_Default.P_FloorStock_Acct
|
||||
56544, -- C_AcctSchema_Default.P_Labor_Acct
|
||||
56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct
|
||||
56541, -- C_AcctSchema_Default.P_MixVariance_Acct
|
||||
56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct
|
||||
56567, -- C_AcctSchema_Default.P_Overhead_Acct
|
||||
56568, -- C_AcctSchema_Default.P_Scrap_Acct
|
||||
56539, -- C_AcctSchema_Default.P_UsageVariance_Acct
|
||||
56537, -- C_AcctSchema_Default.P_WIP_Acct
|
||||
4856, -- C_AcctSchema_Default.T_Liability_Acct
|
||||
4857, -- C_AcctSchema_Default.T_Receivables_Acct
|
||||
6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct
|
||||
3443, -- C_AcctSchema_Default.W_Inventory_Acct
|
||||
4853, -- C_AcctSchema_Default.Withholding_Acct
|
||||
4843, -- C_AcctSchema_Default.W_Revaluation_Acct
|
||||
2501, -- C_AcctSchema_GL.IncomeSummary_Acct
|
||||
2500, -- C_AcctSchema_GL.RetainedEarning_Acct
|
||||
2493, -- C_AcctSchema_GL.SuspenseError_Acct
|
||||
4901, -- C_BankAccount_Acct.B_Expense_Acct
|
||||
4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct
|
||||
4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct
|
||||
4905, -- C_BankAccount_Acct.B_SettlementGain_Acct
|
||||
4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct
|
||||
4904, -- C_BankAccount_Acct.B_Unidentified_Acct
|
||||
3381, -- C_BP_Employee_Acct.E_Expense_Acct
|
||||
3382, -- C_BP_Employee_Acct.E_Prepayment_Acct
|
||||
4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct
|
||||
4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct
|
||||
10287, -- C_Currency_Acct.RealizedGain_Acct
|
||||
10289, -- C_Currency_Acct.RealizedLoss_Acct
|
||||
10279, -- C_Currency_Acct.UnrealizedGain_Acct
|
||||
10290, -- C_Currency_Acct.UnrealizedLoss_Acct
|
||||
5085, -- C_Tax_Acct.T_Liability_Acct
|
||||
5087, -- C_Tax_Acct.T_Receivables_Acct
|
||||
56565, -- M_Product_Acct.P_Burden_Acct
|
||||
56563, -- M_Product_Acct.P_CostOfProduction_Acct
|
||||
56562, -- M_Product_Acct.P_FloorStock_Acct
|
||||
56564, -- M_Product_Acct.P_Labor_Acct
|
||||
56558, -- M_Product_Acct.P_MethodChangeVariance_Acct
|
||||
56561, -- M_Product_Acct.P_MixVariance_Acct
|
||||
56566, -- M_Product_Acct.P_OutsideProcessing_Acct
|
||||
56571, -- M_Product_Acct.P_Overhead_Acct
|
||||
56572, -- M_Product_Acct.P_Scrap_Acct
|
||||
56559, -- M_Product_Acct.P_UsageVariance_Acct
|
||||
56557, -- M_Product_Acct.P_WIP_Acct
|
||||
56555, -- M_Product_Category_Acct.P_Burden_Acct
|
||||
56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct
|
||||
56547, -- M_Product_Category_Acct.P_FloorStock_Acct
|
||||
56554, -- M_Product_Category_Acct.P_Labor_Acct
|
||||
56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct
|
||||
56552, -- M_Product_Category_Acct.P_MixVariance_Acct
|
||||
56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct
|
||||
56569, -- M_Product_Category_Acct.P_Overhead_Acct
|
||||
56570, -- M_Product_Category_Acct.P_Scrap_Acct
|
||||
56550, -- M_Product_Category_Acct.P_UsageVariance_Acct
|
||||
56548, -- M_Product_Category_Acct.P_WIP_Acct
|
||||
6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct
|
||||
3386, -- M_Warehouse_Acct.W_Inventory_Acct
|
||||
5133 -- M_Warehouse_Acct.W_Revaluation_Acct
|
||||
)
|
||||
;
|
||||
|
||||
---
|
||||
UPDATE AD_PrintFormatItem SET IsActive='N' WHERE AD_Column_ID IN (
|
||||
4862, -- C_AcctSchema_Default.B_Expense_Acct
|
||||
4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct
|
||||
4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct
|
||||
4866, -- C_AcctSchema_Default.B_SettlementGain_Acct
|
||||
4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct
|
||||
4865, -- C_AcctSchema_Default.B_Unidentified_Acct
|
||||
3449, -- C_AcctSchema_Default.E_Expense_Acct
|
||||
3450, -- C_AcctSchema_Default.E_Prepayment_Acct
|
||||
4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct
|
||||
4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct
|
||||
56545, -- C_AcctSchema_Default.P_Burden_Acct
|
||||
56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct
|
||||
56542, -- C_AcctSchema_Default.P_FloorStock_Acct
|
||||
56544, -- C_AcctSchema_Default.P_Labor_Acct
|
||||
56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct
|
||||
56541, -- C_AcctSchema_Default.P_MixVariance_Acct
|
||||
56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct
|
||||
56567, -- C_AcctSchema_Default.P_Overhead_Acct
|
||||
56568, -- C_AcctSchema_Default.P_Scrap_Acct
|
||||
56539, -- C_AcctSchema_Default.P_UsageVariance_Acct
|
||||
56537, -- C_AcctSchema_Default.P_WIP_Acct
|
||||
4856, -- C_AcctSchema_Default.T_Liability_Acct
|
||||
4857, -- C_AcctSchema_Default.T_Receivables_Acct
|
||||
6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct
|
||||
3443, -- C_AcctSchema_Default.W_Inventory_Acct
|
||||
4853, -- C_AcctSchema_Default.Withholding_Acct
|
||||
4843, -- C_AcctSchema_Default.W_Revaluation_Acct
|
||||
2501, -- C_AcctSchema_GL.IncomeSummary_Acct
|
||||
2500, -- C_AcctSchema_GL.RetainedEarning_Acct
|
||||
2493, -- C_AcctSchema_GL.SuspenseError_Acct
|
||||
4901, -- C_BankAccount_Acct.B_Expense_Acct
|
||||
4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct
|
||||
4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct
|
||||
4905, -- C_BankAccount_Acct.B_SettlementGain_Acct
|
||||
4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct
|
||||
4904, -- C_BankAccount_Acct.B_Unidentified_Acct
|
||||
3381, -- C_BP_Employee_Acct.E_Expense_Acct
|
||||
3382, -- C_BP_Employee_Acct.E_Prepayment_Acct
|
||||
4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct
|
||||
4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct
|
||||
10287, -- C_Currency_Acct.RealizedGain_Acct
|
||||
10289, -- C_Currency_Acct.RealizedLoss_Acct
|
||||
10279, -- C_Currency_Acct.UnrealizedGain_Acct
|
||||
10290, -- C_Currency_Acct.UnrealizedLoss_Acct
|
||||
5085, -- C_Tax_Acct.T_Liability_Acct
|
||||
5087, -- C_Tax_Acct.T_Receivables_Acct
|
||||
56565, -- M_Product_Acct.P_Burden_Acct
|
||||
56563, -- M_Product_Acct.P_CostOfProduction_Acct
|
||||
56562, -- M_Product_Acct.P_FloorStock_Acct
|
||||
56564, -- M_Product_Acct.P_Labor_Acct
|
||||
56558, -- M_Product_Acct.P_MethodChangeVariance_Acct
|
||||
56561, -- M_Product_Acct.P_MixVariance_Acct
|
||||
56566, -- M_Product_Acct.P_OutsideProcessing_Acct
|
||||
56571, -- M_Product_Acct.P_Overhead_Acct
|
||||
56572, -- M_Product_Acct.P_Scrap_Acct
|
||||
56559, -- M_Product_Acct.P_UsageVariance_Acct
|
||||
56557, -- M_Product_Acct.P_WIP_Acct
|
||||
56555, -- M_Product_Category_Acct.P_Burden_Acct
|
||||
56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct
|
||||
56547, -- M_Product_Category_Acct.P_FloorStock_Acct
|
||||
56554, -- M_Product_Category_Acct.P_Labor_Acct
|
||||
56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct
|
||||
56552, -- M_Product_Category_Acct.P_MixVariance_Acct
|
||||
56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct
|
||||
56569, -- M_Product_Category_Acct.P_Overhead_Acct
|
||||
56570, -- M_Product_Category_Acct.P_Scrap_Acct
|
||||
56550, -- M_Product_Category_Acct.P_UsageVariance_Acct
|
||||
56548, -- M_Product_Category_Acct.P_WIP_Acct
|
||||
6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct
|
||||
3386, -- M_Warehouse_Acct.W_Inventory_Acct
|
||||
5133 -- M_Warehouse_Acct.W_Revaluation_Acct
|
||||
)
|
||||
;
|
||||
|
||||
-- Sep 27, 2012 11:08:01 AM COT
|
||||
UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-09-27 11:08:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=214
|
||||
;
|
||||
|
||||
|
||||
-- Sep 28, 2012 1:14:51 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2012-09-28 13:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1370
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:15:22 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Tab SET IsActive='N',Updated=TO_DATE('2012-09-28 13:15:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=569
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:20:15 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_DATE('2012-09-28 13:20:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56547
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:20:51 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_DATE('2012-09-28 13:20:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56537
|
||||
;
|
||||
|
||||
SELECT register_migration_script('915_IDEMPIERE-362.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,388 @@
|
|||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
-- Hide Payroll to be managed as extension
|
||||
|
||||
-- Sep 20, 2012 7:59:44 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-20 19:59:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53114
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:41 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53036
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:41 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Concept Catalog', Description='Maintain Payroll Concept Catalog', IsActive='N',Updated=TO_DATE('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53115
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:41 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50084
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:48 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53039
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:48 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Concept Category', Description='Maintain Payroll Concept Category', IsActive='N',Updated=TO_DATE('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53118
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:48 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50075
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:59 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53032
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:59 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Contract', Description='Maintain Payroll Contract', IsActive='N',Updated=TO_DATE('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53110
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:59 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50076
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:04 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53038
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:04 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Definition', Description='In a company, payroll is the sum of all financial records of salaries, wages, bonuses, and deductions.', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53117
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:04 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50074
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:08 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53034
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:08 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Department', Description='Maintain Payroll Department', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53112
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:08 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50079
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:13 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53033
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:13 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Employee', Description='Maintain Payroll Employee', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53111
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:13 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50080
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:18 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53035
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:18 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Job', Description='Maintain Payroll Job', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53113
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:18 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50083
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:42 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53042
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:42 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Movement', Description='History of Payroll Movement', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53121
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:48 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53037
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:48 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Process', Description='Payroll Process', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53127
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:48 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50077
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:55 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53041
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:55 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Table', Description='Maintain Payroll Table', IsActive='N',Updated=TO_DATE('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53120
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:55 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50078
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:03:03 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53040
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:03:03 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Table Type', Description='Maintain Payroll Table Type', IsActive='N',Updated=TO_DATE('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53119
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:03:03 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_DATE('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50082
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:07:59 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:07:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53124
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53124
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=530
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53109
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53114
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=266
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=232
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=190
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=127
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=133
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=172
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=173
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53256
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=110
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=394
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=544
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=512
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=506
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=420
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=451
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=186
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=473
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=17, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=531
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53124
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53109
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53114
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=266
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=232
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=190
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=127
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=133
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=172
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=173
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53256
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=110
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=394
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=544
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=512
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=506
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=420
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=451
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=186
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=473
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=17, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=531
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=18, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=530
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:02 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53123
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:11 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53116
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:15 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53122
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:28 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53109
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:33 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_DATE('2012-09-28 13:11:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53108
|
||||
;
|
||||
|
||||
SELECT register_migration_script('916_IDEMPIERE-362.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
-- Sep 21, 2012 8:07:08 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N''',Updated=TO_DATE('2012-09-21 20:07:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:15 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARR'', ''APP'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=149
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:20 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52004
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:24 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=201
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:28 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:42 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND C_DocType.IsSOTrx=''N'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:07:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52054
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:05 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND C_DocType.IsSOTrx=''N''',Updated=TO_DATE('2012-09-21 20:08:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:26 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:30 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLJ'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=102
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:36 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=173
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:41 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=121
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:47 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2012-09-21 20:08:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124
|
||||
;
|
||||
|
||||
SELECT register_migration_script('917_IDEMPIERE-366.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,22 @@
|
|||
-- Sep 27, 2012 12:32:31 PM SGT
|
||||
-- IDEMPIERE-373 Implement User Locking
|
||||
UPDATE AD_Message SET MsgText='Reached the maximum number of login attempts, user account ({0}) is locked',Updated=TO_DATE('2012-09-27 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200033
|
||||
;
|
||||
|
||||
-- Sep 27, 2012 12:32:31 PM SGT
|
||||
-- IDEMPIERE-373 Implement User Locking
|
||||
UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200033
|
||||
;
|
||||
|
||||
-- Sep 27, 2012 12:32:59 PM SGT
|
||||
-- IDEMPIERE-373 Implement User Locking
|
||||
UPDATE AD_Message SET MsgText='User account ({0}) is locked, please contact the system administrator',Updated=TO_DATE('2012-09-27 12:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200032
|
||||
;
|
||||
|
||||
-- Sep 27, 2012 12:32:59 PM SGT
|
||||
-- IDEMPIERE-373 Implement User Locking
|
||||
UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200032
|
||||
;
|
||||
|
||||
SELECT register_migration_script('919_IDEMPIERE-373_User_Locking.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,178 @@
|
|||
-- Sep 25, 2012 1:46:23 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=930
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:30 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=931
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:35 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59592
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:40 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59591
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:46 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10126
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:52 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=52018
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:57 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8740
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:04 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5227
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:10 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11006
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:16 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11003
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:23 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11002
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:30 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:47:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8311
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:49:28 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:49:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10813
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:49:40 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N and @IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:49:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11256
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:49:50 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N and @IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:49:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11257
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:49:56 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:49:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8313
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:01 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8314
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:06 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8312
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:22 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8310
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:26 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12367
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:31 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12368
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:40 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200071
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:45 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:50:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50168
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:14 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50169
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:19 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50170
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:35 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50172
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:40 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50173
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:45 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50174
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:50 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50175
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:55 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:51:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50176
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:52:00 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:52:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50177
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:52:04 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_DATE('2012-09-25 13:52:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50178
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:58:27 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Column SET ReadOnlyLogic=NULL,DefaultValue=NULL,Updated=TO_DATE('2012-09-25 13:58:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=534
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 2:19:54 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N & @IsMasterRole@=N',Updated=TO_DATE('2012-09-25 14:19:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11256
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 2:20:02 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N & @IsMasterRole@=N',Updated=TO_DATE('2012-09-25 14:20:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11257
|
||||
;
|
||||
|
||||
SELECT register_migration_script('920_IDEMPIERE_366.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
CREATE OR REPLACE PROCEDURE nextID
|
||||
(
|
||||
p_AD_Sequence_ID IN NUMBER,
|
||||
p_System IN CHAR,
|
||||
o_NextID OUT NUMBER
|
||||
)
|
||||
/*************************************************************************
|
||||
* The contents of this file are subject to the Adempiere License. You may
|
||||
* obtain a copy of the License at http://www.adempiere.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: Adempiere ERP+CRM
|
||||
* Copyright (C) 1999-2005 Jorg Janke, ComPiere, Inc. All Rights Reserved.
|
||||
*************************************************************************
|
||||
* $Id: nextID.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
|
||||
***
|
||||
* Title: Get Next ID - no Commit
|
||||
* Description:
|
||||
* Test via
|
||||
*
|
||||
************************************************************************/
|
||||
AS
|
||||
Isnativeseqon NVARCHAR2(1);
|
||||
Tablename Nvarchar2(60);
|
||||
sqlcmd VARCHAR2(200);
|
||||
BEGIN
|
||||
|
||||
|
||||
IF (p_System = 'Y') THEN
|
||||
SELECT CurrentNextSys
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID
|
||||
FOR UPDATE OF CurrentNextSys;
|
||||
--
|
||||
UPDATE AD_Sequence
|
||||
SET CurrentNextSys = CurrentNextSys + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
ELSE
|
||||
|
||||
Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0);
|
||||
IF Isnativeseqon = 'Y' THEN
|
||||
|
||||
SELECT Name
|
||||
INTO tablename
|
||||
FROM Ad_Sequence
|
||||
WHERE Ad_Sequence_Id=P_Ad_Sequence_Id;
|
||||
--
|
||||
Sqlcmd := 'SELECT '||Tablename||'_SQ.Nextval FROM DUAL';
|
||||
--
|
||||
Execute Immediate Sqlcmd Into O_Nextid;
|
||||
--
|
||||
ELSE
|
||||
|
||||
SELECT CurrentNext
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID
|
||||
FOR UPDATE OF CurrentNext;
|
||||
--
|
||||
UPDATE Ad_Sequence
|
||||
SET Currentnext = Currentnext + Incrementno
|
||||
WHERE Ad_Sequence_Id=P_Ad_Sequence_Id;
|
||||
--
|
||||
END IF;
|
||||
END IF;
|
||||
--
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
DBMS_OUTPUT.PUT_LINE(SQLERRM);
|
||||
END nextID;
|
||||
/
|
||||
|
||||
DROP SEQUENCE ad_error_seq
|
||||
;
|
||||
|
||||
DROP SEQUENCE ad_pinstance_seq
|
||||
;
|
||||
|
||||
DROP SEQUENCE t_spool_seq
|
||||
;
|
||||
|
||||
DROP SEQUENCE w_basket_seq
|
||||
;
|
||||
|
||||
SELECT register_migration_script('921_IDEMPIERE-422_NativeSequence.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( b_expense_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( b_revaluationgain_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( b_revaluationloss_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( b_settlementgain_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( b_settlementloss_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( b_unidentified_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( e_expense_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( e_prepayment_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( notinvoicedreceivables_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( notinvoicedrevenue_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( t_liability_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( t_receivables_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( w_invactualadjust_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( w_inventory_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( w_revaluation_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_default MODIFY ( withholding_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_gl MODIFY ( incomesummary_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_acctschema_gl MODIFY ( retainedearning_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_bankaccount_acct MODIFY ( b_expense_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_bankaccount_acct MODIFY ( b_revaluationgain_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_bankaccount_acct MODIFY ( b_revaluationloss_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_bankaccount_acct MODIFY ( b_settlementgain_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_bankaccount_acct MODIFY ( b_settlementloss_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_bankaccount_acct MODIFY ( b_unidentified_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_bp_group_acct MODIFY ( notinvoicedreceivables_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_bp_group_acct MODIFY ( notinvoicedrevenue_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_currency_acct MODIFY ( realizedgain_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_currency_acct MODIFY ( realizedloss_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_currency_acct MODIFY ( unrealizedgain_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_currency_acct MODIFY ( unrealizedloss_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_tax_acct MODIFY ( t_liability_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE c_tax_acct MODIFY ( t_receivables_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE m_warehouse_acct MODIFY ( w_invactualadjust_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE m_warehouse_acct MODIFY ( w_inventory_acct NUMBER(10) NULL );
|
||||
|
||||
ALTER TABLE m_warehouse_acct MODIFY ( w_revaluation_acct NUMBER(10) NULL );
|
||||
|
||||
SELECT register_migration_script('922_IDEMPIERE-362.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,365 @@
|
|||
-- Sep 4, 2012 10:34:50 AM COT
|
||||
-- Element Master Role
|
||||
INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsMasterRole',200117,'D','MasterRole','MasterRole','4bad6035-f81b-4e25-81d9-bbf55b099113',0,TO_TIMESTAMP('2012-09-04 10:34:49','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-04 10:34:49','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y')
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:34:50 AM COT
|
||||
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200117 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:36:19 AM COT
|
||||
-- Column master Role
|
||||
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection,DefaultValue) VALUES (0,156,200410,'D','Y','N','N',0,'N',1,'N',20,'N','N',200117,'N','Y','5ec60b3e-f1a7-447c-a7ea-f3575dcb24d4','N','Y','N','IsMasterRole','MasterRole','Y',100,TO_TIMESTAMP('2012-09-04 10:36:18','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-09-04 10:36:18','YYYY-MM-DD HH24:MI:SS'),100,0,0,'N')
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:36:19 AM COT
|
||||
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200410 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:37:58 AM COT
|
||||
-- Field Master Role
|
||||
INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',119,1,'N','N',200410,'Y',200411,'N','D','MasterRole','Y','N','b57a3894-98be-44fa-a834-6883c8824d92',100,0,TO_TIMESTAMP('2012-09-04 10:37:58','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-09-04 10:37:58','YYYY-MM-DD HH24:MI:SS'),'Y')
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:37:58 AM COT
|
||||
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200411 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:38:27 AM COT
|
||||
-- seq
|
||||
UPDATE AD_Field SET SeqNo=440,IsDisplayed='Y' WHERE AD_Field_ID=200411
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 10:38:40 AM COT
|
||||
-- Position web
|
||||
UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-09-04 10:38:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200411
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 4:12:10 PM COT
|
||||
-- Validation for just Master Role in included roles
|
||||
INSERT INTO AD_Val_Rule (Code,AD_Val_Rule_ID,EntityType,Name,Type,AD_Val_Rule_UU,CreatedBy,UpdatedBy,Updated,Created,AD_Client_ID,IsActive,AD_Org_ID) VALUES ('AD_Role.IsMasterRole=''Y''',200006,'D','MasterRoles','S','5d5fa599-0937-4e88-905b-b0814fc7fc84',100,100,TO_TIMESTAMP('2012-09-04 16:12:08','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-04 16:12:08','YYYY-MM-DD HH24:MI:SS'),0,'Y',0)
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 4:13:06 PM COT
|
||||
UPDATE AD_Column SET AD_Val_Rule_ID=200006, IsUpdateable='N',Updated=TO_TIMESTAMP('2012-09-04 16:13:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=57949
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 4:55:32 PM COT
|
||||
-- Display Logic Window Role
|
||||
UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-04 16:55:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=351
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 4:55:40 PM COT
|
||||
-- Display Logic Window Role
|
||||
UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-04 16:55:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=120
|
||||
;
|
||||
|
||||
-- Sep 4, 2012 4:55:53 PM COT
|
||||
-- Display Logic Window Role
|
||||
UPDATE AD_Tab SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-04 16:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53240
|
||||
;
|
||||
|
||||
|
||||
-- Sep 5, 2012 2:26:43 PM COT
|
||||
-- Roles are manual for default
|
||||
UPDATE AD_Column SET DefaultValue='Y',Updated=TO_TIMESTAMP('2012-09-05 14:26:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=9593
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 6:56:24 PM COT
|
||||
ALTER TABLE AD_Role ADD COLUMN IsMasterRole CHAR(1) DEFAULT 'N' CHECK (IsMasterRole IN ('Y','N')) NOT NULL
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 6:56:46 PM COT
|
||||
INSERT INTO t_alter_column values('ad_role','IsManual','CHAR(1)','not null','Y')
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=200411
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=930
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=931
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=59592
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=59591
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=10126
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=52018
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=8740
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=5227
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=11006
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=11003
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=11002
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=8311
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=10813
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=11256
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=11257
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=8313
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=8314
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=8312
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=8310
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=12367
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=12368
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=12641
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=200071
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=50168
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=50169
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=50170
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=50171
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=50172
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=50173
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=50174
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=50175
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=50176
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:22 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=50177
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:23 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=50178
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:23 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=430,IsDisplayed='Y' WHERE AD_Field_ID=55432
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:39:23 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET SeqNo=440,IsDisplayed='Y' WHERE AD_Field_ID=55433
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Element SET Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', PrintName='Master Role',Updated=TO_TIMESTAMP('2012-09-11 20:43:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200117
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=200117
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Column SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Element_ID=200117
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Process_Para SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL, AD_Element_ID=200117 WHERE UPPER(ColumnName)='ISMASTERROLE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Process_Para SET ColumnName='IsMasterRole', Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Element_ID=200117 AND IsCentrallyMaintained='Y'
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Field SET Name='Master Role', Description='A master role cannot be assigned to users, it is intended to define access to menu option and documents and inherit to other roles', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=200117) AND IsCentrallyMaintained='Y'
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:43:59 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_PrintFormatItem SET PrintName='Master Role', Name='Master Role' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=200117)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 10:48:11 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLJ'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-11 22:48:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=102
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:38:13 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:38:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124
|
||||
;
|
||||
|
||||
|
||||
-- Sep 12, 2012 11:40:18 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:40:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=121
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:41:16 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:41:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=173
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:41:30 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:41:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:41:39 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:41:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52054
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:41:55 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:41:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:42:02 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:42:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=201
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:42:08 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:42:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52004
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 11:42:16 AM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@''',Updated=TO_TIMESTAMP('2012-09-12 11:42:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066
|
||||
;
|
||||
|
||||
|
||||
-- Sep 12, 2012 6:20:08 PM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-12 18:20:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:28:44 PM COT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARR'', ''APP'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-12 18:28:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=149
|
||||
;
|
||||
|
||||
|
||||
|
||||
UPDATE AD_System
|
||||
SET LastMigrationScriptApplied='899_IDEMPIERE_366.sql'
|
||||
WHERE LastMigrationScriptApplied<'899_IDEMPIERE_366.sql'
|
||||
OR LastMigrationScriptApplied IS NULL
|
||||
;
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
-- Sep 11, 2012 8:42:54 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Invoice Processed: ',200060,'U','3c06a457-be2c-4e54-a197-ac5b5646143f','InvoiceProcessed','Y',TO_TIMESTAMP('2012-09-11 20:42:53','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 20:42:53','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:42:55 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200060 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:49:40 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Payment Allocated: ',200061,'U','2d9d4e87-b308-4643-9046-a2730a95cb9b','PaymentAllocated','Y',TO_TIMESTAMP('2012-09-11 20:49:39','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 20:49:39','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:49:40 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200061 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:52:47 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Allocation Processed: ',200062,'U','5e6e24fc-a609-4424-9aa4-f30f13fa03ac','AllocationProcessed','Y',TO_TIMESTAMP('2012-09-11 20:52:46','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 20:52:46','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:52:47 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200062 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:54:59 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Shipment Processed: ',200063,'U','1de82564-7da4-468e-955d-7451a304844d','ShipmentProcessed','Y',TO_TIMESTAMP('2012-09-11 20:54:58','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 20:54:58','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 8:54:59 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200063 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 9:00:52 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Order Created: ',200064,'U','0e54bec9-9529-4ac8-b453-b36b201b5149','OrderCreated','Y',TO_TIMESTAMP('2012-09-11 21:00:51','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 21:00:51','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 9:00:52 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200064 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 9:05:34 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Generated PO: ',200065,'U','f0135f4a-27e6-499c-9c7e-851631a10a4f','GeneratedPO','Y',TO_TIMESTAMP('2012-09-11 21:05:33','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-11 21:05:33','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 11, 2012 9:05:34 PM IST
|
||||
-- Adding i18n messages
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200065 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
SELECT register_migration_script('908_Process_Message.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,36 @@
|
|||
-- Sep 12, 2012 6:56:41 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
INSERT INTO AD_SysConfig (AD_SysConfig_ID,EntityType,ConfigurationLevel,Value,Description,AD_SysConfig_UU,Created,Updated,AD_Client_ID,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name) VALUES (200020,'D','S','Y','New password must differs from the old password','13b5a576-7b91-471b-8b40-05589dd585f7',TO_TIMESTAMP('2012-09-12 18:56:39','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-12 18:56:39','YYYY-MM-DD HH24:MI:SS'),0,0,100,'Y',100,'CHANGE_PASSWORD_MUST_DIFFER')
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:57:05 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
UPDATE AD_Column SET FieldLength=1024,Updated=TO_TIMESTAMP('2012-09-12 18:57:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200457
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:57:13 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
INSERT INTO t_alter_column values('ad_user','SecurityQuestion','VARCHAR(1024)',null,'NULL')
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:58:41 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','New Password must differ from Old Password',200066,'U','0d873a03-0980-4725-8a4f-a6954e4ee59e','NewPasswordMustDiffer','Y',TO_TIMESTAMP('2012-09-12 18:58:40','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-12 18:58:40','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:58:41 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200066 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 12, 2012 6:58:45 PM SGT
|
||||
-- IDEMPIERE-375 Implement Forgot my Password
|
||||
UPDATE AD_Message SET EntityType='D',Updated=TO_TIMESTAMP('2012-09-12 18:58:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200066
|
||||
;
|
||||
|
||||
UPDATE AD_User u SET SecurityQuestion = (
|
||||
SELECT MAX(m.MsgText) FROM AD_Message m WHERE m.Value = u.SecurityQuestion)
|
||||
WHERE u.SecurityQuestion IS NOT NULL;
|
||||
|
||||
SELECT register_migration_script('910_IDEMPIERE-375.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,36 @@
|
|||
-- Sep 17, 2012 5:24:55 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:24:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=124
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:09 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=121
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:14 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=173
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:30 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52054
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:38 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=125
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:44 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=201
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:49 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:25:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52004
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:26:19 PM COT
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N'' AND AD_Client_ID=@AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-17 17:26:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Val_Rule_ID=52066
|
||||
;
|
||||
|
||||
SELECT register_migration_script('911_IDEMPIERE-366.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,202 @@
|
|||
-- Sep 18, 2012 2:38:36 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Form (AccessLevel,Classname,AD_Form_ID,Help,IsBetaFunctionality,EntityType,AD_Form_UU,Description,Name,AD_Org_ID,UpdatedBy,CreatedBy,Updated,Created,AD_Client_ID,IsActive) VALUES ('1','org.compiere.apps.form.VResetPassword',200001,NULL,'N','D','e2db983d-c11a-46f7-a4f5-fca8167c8d6c','Reset Password','Reset Password',0,100,100,TO_TIMESTAMP('2012-09-18 14:38:34','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-09-18 14:38:34','YYYY-MM-DD HH24:MI:SS'),0,'Y')
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:38:38 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Form_Trl (AD_Language,AD_Form_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Form_Trl_UU ) SELECT l.AD_Language,t.AD_Form_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Form t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Form_ID=200001 AND NOT EXISTS (SELECT * FROM AD_Form_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Form_ID=t.AD_Form_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:13 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Menu (AD_Menu_ID,IsSummary,IsSOTrx,IsReadOnly,AD_Form_ID,EntityType,IsCentrallyMaintained,Name,Description,"action",AD_Menu_UU,IsActive,AD_Client_ID,CreatedBy,Updated,AD_Org_ID,Created,UpdatedBy) VALUES (200017,'N','N','N',200001,'D','Y','Reset Password','Reset Passwords for User','X','c9aa4c76-894d-4a72-97de-38d0345fd477','Y',0,100,TO_TIMESTAMP('2012-09-18 14:39:12','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2012-09-18 14:39:12','YYYY-MM-DD HH24:MI:SS'),100)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:14 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Menu_Trl_UU ) SELECT l.AD_Language,t.AD_Menu_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=200017 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:14 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNodeMM_UU) SELECT t.AD_Client_ID, 0, 'Y', CURRENT_TIMESTAMP, 100, CURRENT_TIMESTAMP, 100,t.AD_Tree_ID, 200017, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200017)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200002
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=147
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53246
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200017
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=487
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200012
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=150
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=495
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=50007
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=362
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=200001
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=475
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=366
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=483
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=368
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=508
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:24 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=367, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53348
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:32 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
DELETE FROM AD_Menu_Trl WHERE AD_Menu_ID=487
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:33 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
DELETE FROM AD_Menu WHERE AD_Menu_ID=487
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:39:33 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
DELETE FROM AD_TreeNodeMM WHERE Node_ID=487 AND EXISTS (SELECT * FROM AD_Tree t WHERE t.AD_Tree_ID=AD_TreeNodeMM.AD_Tree_ID AND t.TreeType='MM')
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:48:49 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
UPDATE AD_Form SET AccessLevel='7',Updated=TO_TIMESTAMP('2012-09-18 14:48:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Form_ID=200001
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:32:53 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','User is Mandatory',NULL,200067,'D','40544a9e-776d-4f96-8ef1-f38de2237027','UserMandatory','Y',TO_TIMESTAMP('2012-09-18 16:32:51','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:32:51','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:32:53 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200067 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:35:14 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','New EMail does not match the Confirm New EMail',200068,'D','5046c7a0-0846-4f09-b130-d8280a043775','NewEmailNotMatch','Y',TO_TIMESTAMP('2012-09-18 16:35:13','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:35:13','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:35:14 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200068 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:35:51 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('E','Confirm New EMail is Mandatory',200069,'D','c9e44d6f-af2e-4306-bb84-2df8258ad79c','NewEmailConfirmMandatory','Y',TO_TIMESTAMP('2012-09-18 16:35:50','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:35:50','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:35:51 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200069 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:37:44 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Confirm New EMail',200070,'D','41282b1f-672c-43e0-b823-439b87fa0544','New EMail Confirm','Y',TO_TIMESTAMP('2012-09-18 16:37:43','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:37:43','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:37:44 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200070 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:38:20 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail',200071,'D','6a228718-3a23-46d3-8e0c-97a6511acc50','New EMail','Y',TO_TIMESTAMP('2012-09-18 16:38:19','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:38:19','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:38:20 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200071 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:38:36 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail User',200072,'D','3bf5a60b-20a1-484d-a5f0-11dbe95fcbce','New EMail User','Y',TO_TIMESTAMP('2012-09-18 16:38:35','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:38:35','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:38:36 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200072 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:39:03 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','New EMail User Password',200073,'D','cfe2fcb8-81cc-4df5-b187-f1df99f8f842','New EMail User Password','Y',TO_TIMESTAMP('2012-09-18 16:38:59','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-09-18 16:38:59','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 4:39:03 PM SGT
|
||||
-- IDEMPIERE-374 Change password must be changed to be a form instead of a process
|
||||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200073 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
SELECT register_migration_script('913_IDEMPIERE-374.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,742 @@
|
|||
-- Sep 17, 2012 5:20:18 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:20:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=295
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:20:26 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:20:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=226
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:20:57 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:20:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=300
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:21:11 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:21:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=231
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:23:52 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:23:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=499
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:23:57 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:23:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=308
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:24:38 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:24:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53090
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:24:44 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:24:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53070
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:24:44 PM COT
|
||||
UPDATE AD_Menu SET Name='Prepare Migration Scripts', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:24:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53090
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:24:44 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53090
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:38 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:25:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=448
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:25:42 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:25:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=317
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:26:20 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:26:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=449
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:26:25 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:26:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=316
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:35:04 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=310
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:35:04 PM COT
|
||||
UPDATE AD_Menu SET Name='Auction Buyer', Description='Maintain Auction Buyer Information', IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:35:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=442
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:39:52 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=309
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:39:52 PM COT
|
||||
UPDATE AD_Menu SET Name='Auction Seller', Description='Maintain Auction Seller Information', IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=443
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:40:54 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:40:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=447
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:41:00 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:41:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=307
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:41:52 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:41:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=453
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:41:56 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:41:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=308
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:45:35 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:45:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52000
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:46:02 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:46:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=52003
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:46:02 PM COT
|
||||
UPDATE AD_Menu SET Name='Update Role Menu', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:46:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52000
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:46:02 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=52000
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:51:42 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:51:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52002
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:51:51 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:51:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52000
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:58:52 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:58:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52003
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:58:57 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:58:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52001
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:59:52 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:59:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52004
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 5:59:59 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 17:59:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52002
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:00:47 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:00:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52005
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:00:52 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:00:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=52003
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:01:46 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:01:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53013
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:01:51 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:01:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53002
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:01:51 PM COT
|
||||
UPDATE AD_Menu SET Name='Setup Web POS', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:01:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53013
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:01:51 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53013
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:02:44 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:02:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53196
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:02:49 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:02:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53065
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:02:49 PM COT
|
||||
UPDATE AD_Menu SET Name='Web POS Terminal', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-17 18:02:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53196
|
||||
;
|
||||
|
||||
-- Sep 17, 2012 6:02:49 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53196
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:17:00 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:17:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=392
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:17:59 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:17:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=389
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:18:04 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:18:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=287
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:18:55 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:18:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=390
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 2:19:00 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 14:19:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=290
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:29:19 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:29:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=391
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:29:29 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:29:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=289
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:30:50 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:30:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=590
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:30:55 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=386
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:31:26 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:31:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=591
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:31:30 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:31:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=387
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:32:23 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:32:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=592
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:32:27 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:32:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=388
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:34:02 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:34:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=593
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:34:09 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:34:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=350
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:34:09 PM COT
|
||||
UPDATE AD_Menu SET Name='Rebuild Index', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:34:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=593
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:34:09 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=593
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:52:15 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:52:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=573
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:52:20 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:52:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=379
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:53:08 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:53:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=574
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:53:14 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:53:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=376
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:54:07 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:54:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=576
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:54:11 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:54:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=375
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:58:59 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:58:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=579
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:59:05 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:59:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=373
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:59:45 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:59:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=584
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 5:59:50 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 17:59:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=345
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:00:23 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:00:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=587
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:00:28 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:00:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=383
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:01:07 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:01:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=588
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:01:11 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:01:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=384
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:07:03 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:07:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=52001
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:07:49 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:07:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=460
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:10:10 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53264
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:10:15 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53109
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:10:15 PM COT
|
||||
UPDATE AD_Menu SET Name='Import Product Planning', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53264
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:10:15 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53264
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:17:14 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:17:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=371
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:17:19 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:17:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=269
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:20:15 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:20:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=375
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:20:19 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:20:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=273
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:20:50 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:20:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=380
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:20:56 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:20:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=274
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:21:33 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:21:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=415
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:21:37 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:21:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=239
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:22:07 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:22:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=416
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:22:16 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:22:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=240
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:22:37 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:22:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=372
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:23:27 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:23:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=559
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:23:31 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:23:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=367
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:24:03 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:24:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=560
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:24:07 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:24:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=368
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:24:45 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:24:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=561
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:24:49 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:24:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=369
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:25:23 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:25:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=562
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:25:27 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:25:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=370
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:26:03 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:26:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=563
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:26:08 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:26:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=371
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:26:54 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:26:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=564
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:26:59 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:26:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=372
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:31:03 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:31:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=488
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:31:07 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:31:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=335
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:31:49 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:31:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=489
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:31:53 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:31:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=336
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:32:54 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:32:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=241
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:32:59 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=198
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:35:18 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:35:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=288
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:35:24 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:35:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=170
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:36:45 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:36:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53132
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:36:50 PM COT
|
||||
UPDATE AD_Form SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:36:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Form_ID=53010
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:39:43 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:39:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=187
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:39:49 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:39:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=175
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:40:25 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:40:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=358
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:40:31 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:40:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=261
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:41:15 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=477
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:41:19 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:41:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=329
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:42:01 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:42:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=504
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:42:05 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=311
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:42:46 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:42:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=360
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:42:52 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:42:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=262
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:43:26 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:43:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=498
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:43:32 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=340
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:44:09 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:44:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=532
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:44:12 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:44:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=353
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:08 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53187
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:11 PM COT
|
||||
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=53152
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:11 PM COT
|
||||
UPDATE AD_Menu SET Name='Immediate Bank Transfer', Description=NULL, IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53187
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:11 PM COT
|
||||
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53187
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:48 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53256
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:45:53 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:45:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53104
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:46:37 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:46:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=173
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:46:43 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:46:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=160
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:47:44 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:47:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=284
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:47:48 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:47:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=220
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:48:25 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=344
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:48:30 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:48:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=253
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:51:14 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:51:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=547
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:51:19 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:51:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=359
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:51:50 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:51:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=550
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:51:54 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:51:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=361
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:52:26 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:52:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=551
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:52:30 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:52:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=362
|
||||
;
|
||||
|
||||
-- Sep 18, 2012 6:55:48 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-18 18:55:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53169
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:29:42 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:29:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54416
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:37:37 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:37:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=9286
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:21 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11517
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:38 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11520
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:44 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11521
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:48 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11519
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:53 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11516
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:41:56 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:41:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=11518
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:42:05 AM COT
|
||||
UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=707
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:29 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1494
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:36 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2074
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:41 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1597
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:45 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1492
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:49 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=1495
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:43:56 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:43:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2611
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:44:00 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:44:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=2612
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:44:08 AM COT
|
||||
UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:44:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=214
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:50:54 AM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-19 10:50:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=12360
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:52:39 AM COT
|
||||
UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_TIMESTAMP('2012-09-19 10:52:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=229
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:52:56 AM COT
|
||||
UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_TIMESTAMP('2012-09-19 10:52:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=312
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:53:44 AM COT
|
||||
UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_TIMESTAMP('2012-09-19 10:53:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53015
|
||||
;
|
||||
|
||||
-- Sep 19, 2012 10:54:05 AM COT
|
||||
UPDATE AD_Window SET IsBetaFunctionality='N',Updated=TO_TIMESTAMP('2012-09-19 10:54:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53016
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:12:15 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:12:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=288
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:12:15 PM COT
|
||||
UPDATE AD_Menu SET Name='Knowledge Base', Description='Maintain Knowledge Base', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:12:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=388
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:13:16 PM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:13:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=55432
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:13:24 PM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:13:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=55433
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:13:44 PM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:13:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50171
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:14:47 PM COT
|
||||
UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2012-09-20 18:14:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50201
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:14:51 PM COT
|
||||
UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50201
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:15 PM COT
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=50171
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:24 PM COT
|
||||
UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55333
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:26 PM COT
|
||||
UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55333
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:38 PM COT
|
||||
UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55332
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:15:41 PM COT
|
||||
UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 18:15:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=55332
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:16:02 PM COT
|
||||
INSERT INTO t_alter_column values('ad_role','Allow_Info_MRP','CHAR(1)',null,'N')
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:16:03 PM COT
|
||||
UPDATE AD_Role SET Allow_Info_MRP='N' WHERE Allow_Info_MRP IS NULL
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:16:33 PM COT
|
||||
INSERT INTO t_alter_column values('ad_role','Allow_Info_CRP','CHAR(1)',null,'N')
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:16:34 PM COT
|
||||
UPDATE AD_Role SET Allow_Info_CRP='N' WHERE Allow_Info_CRP IS NULL
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 6:17:03 PM COT
|
||||
INSERT INTO t_alter_column values('ad_role','Allow_Info_CashJournal','CHAR(1)',null,'N')
|
||||
;
|
||||
|
||||
UPDATE AD_Role SET Allow_Info_CashJournal='N', Allow_Info_MRP='N', Allow_Info_CRP='N'
|
||||
;
|
||||
|
||||
SELECT register_migration_script('914_IDEMPIERE-362.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,261 @@
|
|||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
|
||||
-- Sep 19, 2012 4:36:27 PM COT
|
||||
UPDATE AD_Column SET IsActive='N' WHERE AD_Column_ID IN (
|
||||
4862, -- C_AcctSchema_Default.B_Expense_Acct
|
||||
4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct
|
||||
4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct
|
||||
4866, -- C_AcctSchema_Default.B_SettlementGain_Acct
|
||||
4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct
|
||||
4865, -- C_AcctSchema_Default.B_Unidentified_Acct
|
||||
3449, -- C_AcctSchema_Default.E_Expense_Acct
|
||||
3450, -- C_AcctSchema_Default.E_Prepayment_Acct
|
||||
4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct
|
||||
4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct
|
||||
56545, -- C_AcctSchema_Default.P_Burden_Acct
|
||||
56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct
|
||||
56542, -- C_AcctSchema_Default.P_FloorStock_Acct
|
||||
56544, -- C_AcctSchema_Default.P_Labor_Acct
|
||||
56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct
|
||||
56541, -- C_AcctSchema_Default.P_MixVariance_Acct
|
||||
56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct
|
||||
56567, -- C_AcctSchema_Default.P_Overhead_Acct
|
||||
56568, -- C_AcctSchema_Default.P_Scrap_Acct
|
||||
56539, -- C_AcctSchema_Default.P_UsageVariance_Acct
|
||||
56537, -- C_AcctSchema_Default.P_WIP_Acct
|
||||
4856, -- C_AcctSchema_Default.T_Liability_Acct
|
||||
4857, -- C_AcctSchema_Default.T_Receivables_Acct
|
||||
6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct
|
||||
3443, -- C_AcctSchema_Default.W_Inventory_Acct
|
||||
4853, -- C_AcctSchema_Default.Withholding_Acct
|
||||
4843, -- C_AcctSchema_Default.W_Revaluation_Acct
|
||||
2501, -- C_AcctSchema_GL.IncomeSummary_Acct
|
||||
2500, -- C_AcctSchema_GL.RetainedEarning_Acct
|
||||
2493, -- C_AcctSchema_GL.SuspenseError_Acct
|
||||
4901, -- C_BankAccount_Acct.B_Expense_Acct
|
||||
4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct
|
||||
4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct
|
||||
4905, -- C_BankAccount_Acct.B_SettlementGain_Acct
|
||||
4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct
|
||||
4904, -- C_BankAccount_Acct.B_Unidentified_Acct
|
||||
3381, -- C_BP_Employee_Acct.E_Expense_Acct
|
||||
3382, -- C_BP_Employee_Acct.E_Prepayment_Acct
|
||||
4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct
|
||||
4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct
|
||||
10287, -- C_Currency_Acct.RealizedGain_Acct
|
||||
10289, -- C_Currency_Acct.RealizedLoss_Acct
|
||||
10279, -- C_Currency_Acct.UnrealizedGain_Acct
|
||||
10290, -- C_Currency_Acct.UnrealizedLoss_Acct
|
||||
5085, -- C_Tax_Acct.T_Liability_Acct
|
||||
5087, -- C_Tax_Acct.T_Receivables_Acct
|
||||
56565, -- M_Product_Acct.P_Burden_Acct
|
||||
56563, -- M_Product_Acct.P_CostOfProduction_Acct
|
||||
56562, -- M_Product_Acct.P_FloorStock_Acct
|
||||
56564, -- M_Product_Acct.P_Labor_Acct
|
||||
56558, -- M_Product_Acct.P_MethodChangeVariance_Acct
|
||||
56561, -- M_Product_Acct.P_MixVariance_Acct
|
||||
56566, -- M_Product_Acct.P_OutsideProcessing_Acct
|
||||
56571, -- M_Product_Acct.P_Overhead_Acct
|
||||
56572, -- M_Product_Acct.P_Scrap_Acct
|
||||
56559, -- M_Product_Acct.P_UsageVariance_Acct
|
||||
56557, -- M_Product_Acct.P_WIP_Acct
|
||||
56555, -- M_Product_Category_Acct.P_Burden_Acct
|
||||
56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct
|
||||
56547, -- M_Product_Category_Acct.P_FloorStock_Acct
|
||||
56554, -- M_Product_Category_Acct.P_Labor_Acct
|
||||
56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct
|
||||
56552, -- M_Product_Category_Acct.P_MixVariance_Acct
|
||||
56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct
|
||||
56569, -- M_Product_Category_Acct.P_Overhead_Acct
|
||||
56570, -- M_Product_Category_Acct.P_Scrap_Acct
|
||||
56550, -- M_Product_Category_Acct.P_UsageVariance_Acct
|
||||
56548, -- M_Product_Category_Acct.P_WIP_Acct
|
||||
6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct
|
||||
3386, -- M_Warehouse_Acct.W_Inventory_Acct
|
||||
5133 -- M_Warehouse_Acct.W_Revaluation_Acct
|
||||
)
|
||||
;
|
||||
|
||||
|
||||
|
||||
--
|
||||
|
||||
UPDATE AD_Field SET IsActive='N' WHERE AD_Column_ID IN (
|
||||
4862, -- C_AcctSchema_Default.B_Expense_Acct
|
||||
4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct
|
||||
4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct
|
||||
4866, -- C_AcctSchema_Default.B_SettlementGain_Acct
|
||||
4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct
|
||||
4865, -- C_AcctSchema_Default.B_Unidentified_Acct
|
||||
3449, -- C_AcctSchema_Default.E_Expense_Acct
|
||||
3450, -- C_AcctSchema_Default.E_Prepayment_Acct
|
||||
4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct
|
||||
4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct
|
||||
56545, -- C_AcctSchema_Default.P_Burden_Acct
|
||||
56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct
|
||||
56542, -- C_AcctSchema_Default.P_FloorStock_Acct
|
||||
56544, -- C_AcctSchema_Default.P_Labor_Acct
|
||||
56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct
|
||||
56541, -- C_AcctSchema_Default.P_MixVariance_Acct
|
||||
56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct
|
||||
56567, -- C_AcctSchema_Default.P_Overhead_Acct
|
||||
56568, -- C_AcctSchema_Default.P_Scrap_Acct
|
||||
56539, -- C_AcctSchema_Default.P_UsageVariance_Acct
|
||||
56537, -- C_AcctSchema_Default.P_WIP_Acct
|
||||
4856, -- C_AcctSchema_Default.T_Liability_Acct
|
||||
4857, -- C_AcctSchema_Default.T_Receivables_Acct
|
||||
6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct
|
||||
3443, -- C_AcctSchema_Default.W_Inventory_Acct
|
||||
4853, -- C_AcctSchema_Default.Withholding_Acct
|
||||
4843, -- C_AcctSchema_Default.W_Revaluation_Acct
|
||||
2501, -- C_AcctSchema_GL.IncomeSummary_Acct
|
||||
2500, -- C_AcctSchema_GL.RetainedEarning_Acct
|
||||
2493, -- C_AcctSchema_GL.SuspenseError_Acct
|
||||
4901, -- C_BankAccount_Acct.B_Expense_Acct
|
||||
4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct
|
||||
4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct
|
||||
4905, -- C_BankAccount_Acct.B_SettlementGain_Acct
|
||||
4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct
|
||||
4904, -- C_BankAccount_Acct.B_Unidentified_Acct
|
||||
3381, -- C_BP_Employee_Acct.E_Expense_Acct
|
||||
3382, -- C_BP_Employee_Acct.E_Prepayment_Acct
|
||||
4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct
|
||||
4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct
|
||||
10287, -- C_Currency_Acct.RealizedGain_Acct
|
||||
10289, -- C_Currency_Acct.RealizedLoss_Acct
|
||||
10279, -- C_Currency_Acct.UnrealizedGain_Acct
|
||||
10290, -- C_Currency_Acct.UnrealizedLoss_Acct
|
||||
5085, -- C_Tax_Acct.T_Liability_Acct
|
||||
5087, -- C_Tax_Acct.T_Receivables_Acct
|
||||
56565, -- M_Product_Acct.P_Burden_Acct
|
||||
56563, -- M_Product_Acct.P_CostOfProduction_Acct
|
||||
56562, -- M_Product_Acct.P_FloorStock_Acct
|
||||
56564, -- M_Product_Acct.P_Labor_Acct
|
||||
56558, -- M_Product_Acct.P_MethodChangeVariance_Acct
|
||||
56561, -- M_Product_Acct.P_MixVariance_Acct
|
||||
56566, -- M_Product_Acct.P_OutsideProcessing_Acct
|
||||
56571, -- M_Product_Acct.P_Overhead_Acct
|
||||
56572, -- M_Product_Acct.P_Scrap_Acct
|
||||
56559, -- M_Product_Acct.P_UsageVariance_Acct
|
||||
56557, -- M_Product_Acct.P_WIP_Acct
|
||||
56555, -- M_Product_Category_Acct.P_Burden_Acct
|
||||
56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct
|
||||
56547, -- M_Product_Category_Acct.P_FloorStock_Acct
|
||||
56554, -- M_Product_Category_Acct.P_Labor_Acct
|
||||
56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct
|
||||
56552, -- M_Product_Category_Acct.P_MixVariance_Acct
|
||||
56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct
|
||||
56569, -- M_Product_Category_Acct.P_Overhead_Acct
|
||||
56570, -- M_Product_Category_Acct.P_Scrap_Acct
|
||||
56550, -- M_Product_Category_Acct.P_UsageVariance_Acct
|
||||
56548, -- M_Product_Category_Acct.P_WIP_Acct
|
||||
6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct
|
||||
3386, -- M_Warehouse_Acct.W_Inventory_Acct
|
||||
5133 -- M_Warehouse_Acct.W_Revaluation_Acct
|
||||
)
|
||||
;
|
||||
|
||||
---
|
||||
UPDATE AD_PrintFormatItem SET IsActive='N' WHERE AD_Column_ID IN (
|
||||
4862, -- C_AcctSchema_Default.B_Expense_Acct
|
||||
4868, -- C_AcctSchema_Default.B_RevaluationGain_Acct
|
||||
4869, -- C_AcctSchema_Default.B_RevaluationLoss_Acct
|
||||
4866, -- C_AcctSchema_Default.B_SettlementGain_Acct
|
||||
4867, -- C_AcctSchema_Default.B_SettlementLoss_Acct
|
||||
4865, -- C_AcctSchema_Default.B_Unidentified_Acct
|
||||
3449, -- C_AcctSchema_Default.E_Expense_Acct
|
||||
3450, -- C_AcctSchema_Default.E_Prepayment_Acct
|
||||
4873, -- C_AcctSchema_Default.NotInvoicedReceivables_Acct
|
||||
4840, -- C_AcctSchema_Default.NotInvoicedRevenue_Acct
|
||||
56545, -- C_AcctSchema_Default.P_Burden_Acct
|
||||
56543, -- C_AcctSchema_Default.P_CostOfProduction_Acct
|
||||
56542, -- C_AcctSchema_Default.P_FloorStock_Acct
|
||||
56544, -- C_AcctSchema_Default.P_Labor_Acct
|
||||
56538, -- C_AcctSchema_Default.P_MethodChangeVariance_Acct
|
||||
56541, -- C_AcctSchema_Default.P_MixVariance_Acct
|
||||
56546, -- C_AcctSchema_Default.P_OutsideProcessing_Acct
|
||||
56567, -- C_AcctSchema_Default.P_Overhead_Acct
|
||||
56568, -- C_AcctSchema_Default.P_Scrap_Acct
|
||||
56539, -- C_AcctSchema_Default.P_UsageVariance_Acct
|
||||
56537, -- C_AcctSchema_Default.P_WIP_Acct
|
||||
4856, -- C_AcctSchema_Default.T_Liability_Acct
|
||||
4857, -- C_AcctSchema_Default.T_Receivables_Acct
|
||||
6114, -- C_AcctSchema_Default.W_InvActualAdjust_Acct
|
||||
3443, -- C_AcctSchema_Default.W_Inventory_Acct
|
||||
4853, -- C_AcctSchema_Default.Withholding_Acct
|
||||
4843, -- C_AcctSchema_Default.W_Revaluation_Acct
|
||||
2501, -- C_AcctSchema_GL.IncomeSummary_Acct
|
||||
2500, -- C_AcctSchema_GL.RetainedEarning_Acct
|
||||
2493, -- C_AcctSchema_GL.SuspenseError_Acct
|
||||
4901, -- C_BankAccount_Acct.B_Expense_Acct
|
||||
4907, -- C_BankAccount_Acct.B_RevaluationGain_Acct
|
||||
4908, -- C_BankAccount_Acct.B_RevaluationLoss_Acct
|
||||
4905, -- C_BankAccount_Acct.B_SettlementGain_Acct
|
||||
4906, -- C_BankAccount_Acct.B_SettlementLoss_Acct
|
||||
4904, -- C_BankAccount_Acct.B_Unidentified_Acct
|
||||
3381, -- C_BP_Employee_Acct.E_Expense_Acct
|
||||
3382, -- C_BP_Employee_Acct.E_Prepayment_Acct
|
||||
4999, -- C_BP_Group_Acct.NotInvoicedReceivables_Acct
|
||||
4998, -- C_BP_Group_Acct.NotInvoicedRevenue_Acct
|
||||
10287, -- C_Currency_Acct.RealizedGain_Acct
|
||||
10289, -- C_Currency_Acct.RealizedLoss_Acct
|
||||
10279, -- C_Currency_Acct.UnrealizedGain_Acct
|
||||
10290, -- C_Currency_Acct.UnrealizedLoss_Acct
|
||||
5085, -- C_Tax_Acct.T_Liability_Acct
|
||||
5087, -- C_Tax_Acct.T_Receivables_Acct
|
||||
56565, -- M_Product_Acct.P_Burden_Acct
|
||||
56563, -- M_Product_Acct.P_CostOfProduction_Acct
|
||||
56562, -- M_Product_Acct.P_FloorStock_Acct
|
||||
56564, -- M_Product_Acct.P_Labor_Acct
|
||||
56558, -- M_Product_Acct.P_MethodChangeVariance_Acct
|
||||
56561, -- M_Product_Acct.P_MixVariance_Acct
|
||||
56566, -- M_Product_Acct.P_OutsideProcessing_Acct
|
||||
56571, -- M_Product_Acct.P_Overhead_Acct
|
||||
56572, -- M_Product_Acct.P_Scrap_Acct
|
||||
56559, -- M_Product_Acct.P_UsageVariance_Acct
|
||||
56557, -- M_Product_Acct.P_WIP_Acct
|
||||
56555, -- M_Product_Category_Acct.P_Burden_Acct
|
||||
56553, -- M_Product_Category_Acct.P_CostOfProduction_Acct
|
||||
56547, -- M_Product_Category_Acct.P_FloorStock_Acct
|
||||
56554, -- M_Product_Category_Acct.P_Labor_Acct
|
||||
56549, -- M_Product_Category_Acct.P_MethodChangeVariance_Acct
|
||||
56552, -- M_Product_Category_Acct.P_MixVariance_Acct
|
||||
56556, -- M_Product_Category_Acct.P_OutsideProcessing_Acct
|
||||
56569, -- M_Product_Category_Acct.P_Overhead_Acct
|
||||
56570, -- M_Product_Category_Acct.P_Scrap_Acct
|
||||
56550, -- M_Product_Category_Acct.P_UsageVariance_Acct
|
||||
56548, -- M_Product_Category_Acct.P_WIP_Acct
|
||||
6124, -- M_Warehouse_Acct.W_InvActualAdjust_Acct
|
||||
3386, -- M_Warehouse_Acct.W_Inventory_Acct
|
||||
5133 -- M_Warehouse_Acct.W_Revaluation_Acct
|
||||
)
|
||||
;
|
||||
|
||||
|
||||
-- Sep 27, 2012 11:08:01 AM COT
|
||||
UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-27 11:08:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=214
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:14:51 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:14:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1370
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:15:22 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:15:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=569
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:20:15 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_TIMESTAMP('2012-09-28 13:20:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56547
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:20:51 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_TIMESTAMP('2012-09-28 13:20:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56537
|
||||
;
|
||||
|
||||
SELECT register_migration_script('915_IDEMPIERE-362.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,388 @@
|
|||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
-- Hide Payroll to be managed as extension
|
||||
|
||||
-- Sep 20, 2012 7:59:44 PM COT
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 19:59:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53114
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:41 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53036
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:41 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Concept Catalog', Description='Maintain Payroll Concept Catalog', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53115
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:41 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50084
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:48 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53039
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:48 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Concept Category', Description='Maintain Payroll Concept Category', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53118
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:48 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50075
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:59 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53032
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:59 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Contract', Description='Maintain Payroll Contract', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53110
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:01:59 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:01:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50076
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:04 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53038
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:04 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Definition', Description='In a company, payroll is the sum of all financial records of salaries, wages, bonuses, and deductions.', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53117
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:04 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50074
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:08 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53034
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:08 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Department', Description='Maintain Payroll Department', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53112
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:08 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50079
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:13 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53033
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:13 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Employee', Description='Maintain Payroll Employee', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53111
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:13 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50080
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:18 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53035
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:18 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Job', Description='Maintain Payroll Job', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53113
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:18 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50083
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:42 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53042
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:42 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Movement', Description='History of Payroll Movement', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53121
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:48 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53037
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:48 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Process', Description='Payroll Process', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53127
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:48 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50077
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:55 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53041
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:55 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Table', Description='Maintain Payroll Table', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53120
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:02:55 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:02:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50078
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:03:03 PM COT
|
||||
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53040
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:03:03 PM COT
|
||||
UPDATE AD_Menu SET Name='Payroll Table Type', Description='Maintain Payroll Table Type', IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Menu_ID=53119
|
||||
;
|
||||
|
||||
-- Sep 20, 2012 8:03:03 PM COT
|
||||
UPDATE AD_WF_Node SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-20 20:03:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_WF_Node_ID=50082
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:07:59 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:07:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53124
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53124
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=530
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53109
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53114
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=266
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=232
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=190
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=127
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=133
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=172
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=173
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53256
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=110
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=394
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=544
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=512
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=506
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=420
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=451
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=186
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=473
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:54 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=17, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=531
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53124
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53109
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=53108, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53114
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=266
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=232
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=190
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=127
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=133
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=172
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=173
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53256
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=110
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=394
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=544
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=512
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=506
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=420
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=451
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=186
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=473
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=17, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=531
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:08:58 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=165, SeqNo=18, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=530
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:02 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53123
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:11 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53116
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:15 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53122
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:28 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53109
|
||||
;
|
||||
|
||||
-- Sep 28, 2012 1:11:33 PM COT
|
||||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
UPDATE AD_Menu SET IsActive='N',Updated=TO_TIMESTAMP('2012-09-28 13:11:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53108
|
||||
;
|
||||
|
||||
SELECT register_migration_script('916_IDEMPIERE-362.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
-- Sep 21, 2012 8:07:08 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND IsSOTrx=''N''',Updated=TO_TIMESTAMP('2012-09-21 20:07:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:15 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARR'', ''APP'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=149
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:20 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''DOO'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52004
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:24 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=201
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:28 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:07:42 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'') AND C_DocType.IsSOTrx=''N'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:07:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52054
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:05 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@ AND C_DocType.IsSOTrx=''N''',Updated=TO_TIMESTAMP('2012-09-21 20:08:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52066
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:26 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''MMI'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=209
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:30 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLJ'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=102
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:36 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=173
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:41 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType=''GLD'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=121
|
||||
;
|
||||
|
||||
-- Sep 21, 2012 8:08:47 PM COT
|
||||
-- IDEMPIERE-366 Improve Role Inheritance
|
||||
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2012-09-21 20:08:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124
|
||||
;
|
||||
|
||||
SELECT register_migration_script('917_IDEMPIERE-366.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,18 @@
|
|||
-- Sep 27, 2012 12:32:31 PM SGT
|
||||
-- IDEMPIERE-373 Implement User Locking
|
||||
UPDATE AD_Message SET MsgText='Reached the maximum number of login attempts, user account ({0}) is locked',Updated=TO_TIMESTAMP('2012-09-27 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200033
|
||||
;
|
||||
-- Sep 27, 2012 12:32:31 PM SGT
|
||||
-- IDEMPIERE-373 Implement User Locking
|
||||
UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200033
|
||||
;
|
||||
-- Sep 27, 2012 12:32:59 PM SGT
|
||||
-- IDEMPIERE-373 Implement User Locking
|
||||
UPDATE AD_Message SET MsgText='User account ({0}) is locked, please contact the system administrator',Updated=TO_TIMESTAMP('2012-09-27 12:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200032
|
||||
;
|
||||
-- Sep 27, 2012 12:32:59 PM SGT
|
||||
-- IDEMPIERE-373 Implement User Locking
|
||||
UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200032
|
||||
;
|
||||
SELECT register_migration_script('919_IDEMPIERE-373_User_Locking.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,179 @@
|
|||
-- Sep 25, 2012 1:46:23 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=930
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:30 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=931
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:35 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59592
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:40 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59591
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:46 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10126
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:52 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=52018
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:46:57 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:46:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8740
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:04 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5227
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:10 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11006
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:16 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11003
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:23 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11002
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:47:30 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:47:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8311
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:49:28 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:49:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10813
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:49:40 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N and @IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:49:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11256
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:49:50 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N and @IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:49:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11257
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:49:56 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:49:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8313
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:01 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8314
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:06 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8312
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:22 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8310
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:26 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12367
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:31 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12368
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:40 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200071
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:50:45 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:50:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50168
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:14 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50169
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:19 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50170
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:35 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50172
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:40 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50173
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:45 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50174
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:50 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50175
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:51:55 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:51:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50176
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:52:00 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:52:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50177
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:52:04 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 13:52:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50178
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 1:58:27 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Column SET ReadOnlyLogic=NULL,DefaultValue=NULL,Updated=TO_TIMESTAMP('2012-09-25 13:58:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=534
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 2:19:54 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N & @IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 14:19:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11256
|
||||
;
|
||||
|
||||
-- Sep 25, 2012 2:20:02 PM COT
|
||||
-- IDEMPIERE-391 Scheduler improvements
|
||||
UPDATE AD_Field SET DisplayLogic='@IsAccessAllOrgs@=N & @IsMasterRole@=N',Updated=TO_TIMESTAMP('2012-09-25 14:20:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11257
|
||||
;
|
||||
|
||||
|
||||
SELECT register_migration_script('920_IDEMPIERE_366.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
CREATE OR REPLACE FUNCTION nextid(
|
||||
p_AD_Sequence_ID IN INTEGER,
|
||||
p_System IN VARCHAR,
|
||||
o_NextID OUT INTEGER
|
||||
)
|
||||
RETURNS INTEGER AS $body$
|
||||
/*************************************************************************
|
||||
* 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-2005 Jorg Janke, ComPiere, Inc. All Rights Reserved.
|
||||
*
|
||||
* converted to postgreSQL by Karsten Thiemann (Schaeffer AG),
|
||||
* kthiemann@adempiere.org
|
||||
*************************************************************************
|
||||
***
|
||||
* Title: Get Next ID - no Commit
|
||||
* Description: Returns the next id of the sequence.
|
||||
* Test:
|
||||
* select * from nextid((select ad_sequence_id from ad_sequence where name = 'Test')::Integer, 'Y'::Varchar);
|
||||
*
|
||||
************************************************************************/
|
||||
DECLARE
|
||||
Isnativeseqon VARCHAR(1);
|
||||
tablename VARCHAR(60);
|
||||
BEGIN
|
||||
IF (p_System = 'Y') THEN
|
||||
RAISE NOTICE 'system';
|
||||
SELECT CurrentNextSys
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
--
|
||||
UPDATE AD_Sequence
|
||||
SET CurrentNextSys = CurrentNextSys + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
ELSE
|
||||
|
||||
Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0);
|
||||
IF Isnativeseqon = 'Y' THEN
|
||||
SELECT Name
|
||||
INTO tablename
|
||||
FROM Ad_Sequence
|
||||
WHERE Ad_Sequence_Id=P_Ad_Sequence_Id;
|
||||
--
|
||||
EXECUTE 'SELECT nextval('''||tablename||'_sq'''||')' INTO o_NextID;
|
||||
--
|
||||
ELSE
|
||||
SELECT CurrentNext
|
||||
INTO o_NextID
|
||||
FROM AD_Sequence
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
--
|
||||
UPDATE AD_Sequence
|
||||
SET CurrentNext = CurrentNext + IncrementNo
|
||||
WHERE AD_Sequence_ID=p_AD_Sequence_ID;
|
||||
END IF;
|
||||
END IF;
|
||||
--
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
RAISE NOTICE '%',SQLERRM;
|
||||
END;
|
||||
|
||||
$body$ LANGUAGE plpgsql;
|
||||
|
||||
DROP SEQUENCE ad_error_seq
|
||||
;
|
||||
|
||||
DROP SEQUENCE ad_pinstance_seq
|
||||
;
|
||||
|
||||
DROP SEQUENCE t_spool_seq
|
||||
;
|
||||
|
||||
DROP SEQUENCE w_basket_seq
|
||||
;
|
||||
|
||||
SELECT register_migration_script('921_IDEMPIERE-422_NativeSequence.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
-- IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER b_expense_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER b_revaluationgain_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER b_revaluationloss_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER b_settlementgain_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER b_settlementloss_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER b_unidentified_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER e_expense_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER e_prepayment_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER notinvoicedreceivables_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER notinvoicedrevenue_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER t_liability_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER t_receivables_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER w_invactualadjust_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER w_inventory_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER w_revaluation_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_default ALTER withholding_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_gl ALTER incomesummary_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_acctschema_gl ALTER retainedearning_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_bankaccount_acct ALTER b_expense_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_bankaccount_acct ALTER b_revaluationgain_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_bankaccount_acct ALTER b_revaluationloss_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_bankaccount_acct ALTER b_settlementgain_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_bankaccount_acct ALTER b_settlementloss_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_bankaccount_acct ALTER b_unidentified_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_bp_group_acct ALTER notinvoicedreceivables_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_bp_group_acct ALTER notinvoicedrevenue_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_currency_acct ALTER realizedgain_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_currency_acct ALTER realizedloss_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_currency_acct ALTER unrealizedgain_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_currency_acct ALTER unrealizedloss_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_tax_acct ALTER t_liability_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE c_tax_acct ALTER t_receivables_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE m_warehouse_acct ALTER w_invactualadjust_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE m_warehouse_acct ALTER w_inventory_acct DROP NOT NULL;
|
||||
|
||||
ALTER TABLE m_warehouse_acct ALTER w_revaluation_acct DROP NOT NULL;
|
||||
|
||||
SELECT register_migration_script('922_IDEMPIERE-362.sql') FROM dual
|
||||
;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -7,7 +7,9 @@ DECLARE
|
|||
currentnextsys NUMBER (10);
|
||||
currentnext NUMBER (10);
|
||||
currentseqsys NUMBER (10);
|
||||
currentseq NUMBER (10);
|
||||
Currentseq Number (10);
|
||||
Isnativeseqon Varchar2(1);
|
||||
sqlcmd VARCHAR2(200);
|
||||
BEGIN
|
||||
DBMS_OUTPUT.PUT_LINE ('Start');
|
||||
|
||||
|
@ -39,15 +41,16 @@ BEGIN
|
|||
DBMS_OUTPUT.PUT_LINE (cmdsys);
|
||||
GOTO next_iteration;
|
||||
END;
|
||||
|
||||
|
||||
Isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0);
|
||||
IF currentnextsys IS NULL
|
||||
THEN
|
||||
currentnextsys := 0;
|
||||
END IF;
|
||||
|
||||
SELECT DECODE (SIGN (currentnextsys - 50000),
|
||||
-1, 50000,
|
||||
NVL (currentnextsys + 1, 50000)
|
||||
SELECT DECODE (SIGN (currentnextsys - 200000),
|
||||
-1, 200000,
|
||||
NVL (currentnextsys + 1, 200000)
|
||||
)
|
||||
INTO currentnextsys
|
||||
FROM DUAL;
|
||||
|
@ -76,16 +79,26 @@ BEGIN
|
|||
INTO currentnext
|
||||
FROM DUAL;
|
||||
|
||||
cmdseq :=
|
||||
'SELECT currentnext, currentnextsys FROM AD_Sequence '
|
||||
If Isnativeseqon ='Y' Then
|
||||
Cmdseq :=
|
||||
'SELECT '||R.Tablename||'_SQ.Nextval as currentnext,
|
||||
currentnextsys
|
||||
FROM AD_Sequence '
|
||||
|| 'WHERE Name = '''
|
||||
|| r.tablename
|
||||
|| ''' AND istableid = ''Y''';
|
||||
|| r.Tablename
|
||||
|| ''' AND istableid = ''Y''';
|
||||
ELSE
|
||||
cmdseq :=
|
||||
'SELECT currentnext, currentnextsys FROM AD_Sequence '
|
||||
|| 'WHERE Name = '''
|
||||
|| r.tablename
|
||||
|| ''' AND istableid = ''Y''';
|
||||
END IF;
|
||||
|
||||
EXECUTE IMMEDIATE cmdseq
|
||||
INTO currentseq, currentseqsys;
|
||||
|
||||
IF currentnextsys <> currentseqsys OR currentnext <> currentseq
|
||||
IF currentnextsys <> currentseqsys OR (currentnext <> currentseq AND Isnativeseqon ='N')
|
||||
THEN
|
||||
DBMS_OUTPUT.PUT_LINE ( r.tablename
|
||||
|| ' sys='
|
||||
|
@ -108,8 +121,16 @@ BEGIN
|
|||
DBMS_OUTPUT.PUT_LINE (cmdupd);
|
||||
|
||||
EXECUTE IMMEDIATE cmdupd;
|
||||
END IF;
|
||||
|
||||
End If;
|
||||
|
||||
If Currentseq < Currentnext And Isnativeseqon ='Y' Then
|
||||
Sqlcmd := 'SELECT '||R.Tablename||'_SQ.Nextval FROM DUAL';
|
||||
DBMS_OUTPUT.PUT_LINE (Sqlcmd);
|
||||
While Not Currentseq >= (currentnext-1) Loop
|
||||
Execute Immediate Sqlcmd
|
||||
Into currentseq;
|
||||
End Loop;
|
||||
END IF;
|
||||
<<next_iteration>>
|
||||
NULL;
|
||||
END LOOP;
|
||||
|
|
|
@ -11,10 +11,11 @@ DECLARE
|
|||
currentseq NUMERIC (10);
|
||||
ok BOOLEAN;
|
||||
r RECORD;
|
||||
isnativeseqon VARCHAR (1);
|
||||
BEGIN
|
||||
|
||||
FOR r IN (SELECT tablename
|
||||
FROM AD_TABLE t
|
||||
FOR r IN (SELECT tablename
|
||||
FROM AD_TABLE t
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM AD_COLUMN c
|
||||
|
@ -41,14 +42,15 @@ BEGIN
|
|||
END;
|
||||
|
||||
IF ok THEN
|
||||
isnativeseqon := get_Sysconfig('SYSTEM_NATIVE_SEQUENCE','N',0,0);
|
||||
IF currentnextsys IS NULL
|
||||
THEN
|
||||
currentnextsys := 0;
|
||||
END IF;
|
||||
|
||||
SELECT INTO currentnextsys CASE SIGN (currentnextsys - 50000)
|
||||
WHEN -1 THEN 50000
|
||||
ELSE coalesce (currentnextsys + 1, 50000)
|
||||
SELECT INTO currentnextsys CASE SIGN (currentnextsys - 200000)
|
||||
WHEN -1 THEN 200000
|
||||
ELSE coalesce (currentnextsys + 1, 200000)
|
||||
END;
|
||||
|
||||
cmdnosys :=
|
||||
|
@ -72,15 +74,25 @@ BEGIN
|
|||
ELSE coalesce (currentnext + 1, 1000000)
|
||||
END ;
|
||||
|
||||
cmdseq :=
|
||||
'SELECT currentnext, currentnextsys FROM AD_Sequence '
|
||||
|| 'WHERE Name = '''
|
||||
|| r.tablename
|
||||
|| ''' AND istableid = ''Y''';
|
||||
IF isnativeseqon ='Y' THEN
|
||||
cmdseq :=
|
||||
'SELECT nextval('''||trim(r.tablename)||'_sq'''||') as currentnext,
|
||||
currentnextsys
|
||||
FROM AD_Sequence '
|
||||
|| 'WHERE Name = '''
|
||||
|| r.tablename
|
||||
|| ''' AND istableid = ''Y''';
|
||||
ELSE
|
||||
cmdseq :=
|
||||
'SELECT currentnext, currentnextsys FROM AD_Sequence '
|
||||
|| 'WHERE Name = '''
|
||||
|| r.tablename
|
||||
|| ''' AND istableid = ''Y''';
|
||||
END IF;
|
||||
|
||||
EXECUTE cmdseq INTO currentseq, currentseqsys;
|
||||
|
||||
IF currentnextsys <> currentseqsys OR currentnext <> currentseq
|
||||
IF currentnextsys <> currentseqsys OR (currentnext <> currentseq AND isnativeseqon ='N')
|
||||
THEN
|
||||
cmdupd :=
|
||||
'update ad_sequence set currentnextsys = '
|
||||
|
@ -93,8 +105,12 @@ BEGIN
|
|||
|
||||
EXECUTE cmdupd;
|
||||
END IF;
|
||||
IF currentseq < currentnext AND isnativeseqon ='Y' THEN
|
||||
WHILE NOT currentseq >= (currentnext-1) LOOP
|
||||
EXECUTE 'SELECT nextval('''||trim(r.tablename)||'_sq'''||')' INTO currentseq;
|
||||
END LOOP;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
END LOOP;
|
||||
END;
|
||||
$func$ LANGUAGE plpgsql;
|
||||
|
|
|
@ -57,7 +57,7 @@ public class CalloutAssignment extends CalloutEngine
|
|||
return "";
|
||||
|
||||
int M_Product_ID = 0;
|
||||
String Name = null;
|
||||
StringBuilder Name = null;
|
||||
String Description = null;
|
||||
BigDecimal Qty = null;
|
||||
String sql = "SELECT p.M_Product_ID, ra.Name, ra.Description, ra.Qty "
|
||||
|
@ -74,7 +74,7 @@ public class CalloutAssignment extends CalloutEngine
|
|||
if (rs.next())
|
||||
{
|
||||
M_Product_ID = rs.getInt (1);
|
||||
Name = rs.getString(2);
|
||||
Name = new StringBuilder(rs.getString(2));
|
||||
Description = rs.getString(3);
|
||||
Qty = rs.getBigDecimal(4);
|
||||
}
|
||||
|
@ -94,9 +94,9 @@ public class CalloutAssignment extends CalloutEngine
|
|||
{
|
||||
mTab.setValue ("M_Product_ID", new Integer (M_Product_ID));
|
||||
if (Description != null)
|
||||
Name += " (" + Description + ")";
|
||||
if (!".".equals(Name))
|
||||
mTab.setValue("Description", Name);
|
||||
Name.append(" (").append(Description).append(")");
|
||||
if (!".".equals(Name.toString()))
|
||||
mTab.setValue("Description", Name.toString());
|
||||
//
|
||||
String variable = "Qty"; // TimeExpenseLine
|
||||
if (mTab.getTableName().startsWith("C_Order"))
|
||||
|
|
|
@ -1317,8 +1317,9 @@ public class CalloutOrder extends CalloutEngine
|
|||
BigDecimal total = available.subtract(notReserved);
|
||||
if (total.compareTo(QtyOrdered) < 0)
|
||||
{
|
||||
String info = Msg.parseTranslation(ctx, "@QtyAvailable@=" + available
|
||||
+ " - @QtyNotReserved@=" + notReserved + " = " + total);
|
||||
StringBuilder msgpts = new StringBuilder("@QtyAvailable@=").append(available)
|
||||
.append(" - @QtyNotReserved@=").append(notReserved).append(" = ").append(total);
|
||||
String info = Msg.parseTranslation(ctx, msgpts.toString());
|
||||
mTab.fireDataStatusEEvent ("InsufficientQtyAvailable",
|
||||
info, false);
|
||||
}
|
||||
|
|
|
@ -89,9 +89,9 @@ public class ASPGenerateFields extends SvrProcess
|
|||
*/
|
||||
protected String doIt () throws Exception
|
||||
{
|
||||
log.info("ASP_Status=" + p_ASP_Status
|
||||
+ ", ASP_Tab_ID=" + p_ASP_Tab_ID
|
||||
);
|
||||
StringBuilder msglog = new StringBuilder("ASP_Status=").append(p_ASP_Status)
|
||||
.append(", ASP_Tab_ID=").append(p_ASP_Tab_ID);
|
||||
log.info(msglog.toString());
|
||||
|
||||
X_ASP_Tab asptab = new X_ASP_Tab(getCtx(), p_ASP_Tab_ID, get_TrxName());
|
||||
p_ASP_Level_ID = asptab.getASP_Window().getASP_Level_ID();
|
||||
|
|
|
@ -107,10 +107,10 @@ public class ASPGenerateLevel extends SvrProcess
|
|||
*/
|
||||
protected String doIt () throws Exception
|
||||
{
|
||||
log.info("ASP_Status=" + p_ASP_Status
|
||||
+ ", AD_Menu_ID=" + p_AD_Menu_ID
|
||||
+ ", IsGenerateFields=" + p_IsGenerateFields
|
||||
);
|
||||
StringBuilder msglog = new StringBuilder("ASP_Status=").append(p_ASP_Status)
|
||||
.append(", AD_Menu_ID=").append(p_AD_Menu_ID)
|
||||
.append(", IsGenerateFields=").append(p_IsGenerateFields);
|
||||
log.info(msglog.toString());
|
||||
|
||||
MClientInfo clientInfo = MClientInfo.get(getCtx(), getAD_Client_ID(), get_TrxName());
|
||||
int AD_Tree_ID = clientInfo.getAD_Tree_Menu_ID();
|
||||
|
|
|
@ -51,16 +51,16 @@ public class ApplyMigrationScripts extends SvrProcess {
|
|||
protected String doIt() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
log.info("Applying migrations scripts");
|
||||
String sql = "select ad_migrationscript_id, script, name from ad_migrationscript where isApply = 'Y' and status = 'IP' order by name, created";
|
||||
PreparedStatement pstmt = DB.prepareStatement(sql, this.get_TrxName());
|
||||
StringBuilder sql = new StringBuilder()
|
||||
.append("select ad_migrationscript_id, script, name from ad_migrationscript where isApply = 'Y' and status = 'IP' order by name, created");
|
||||
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), this.get_TrxName());
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
byte[] scriptArray = rs.getBytes(2);
|
||||
int seqID = rs.getInt(1);
|
||||
boolean execOk = true;
|
||||
try {
|
||||
StringBuffer tmpSql = new StringBuffer();
|
||||
tmpSql = new StringBuffer(new String(scriptArray));
|
||||
StringBuilder tmpSql = new StringBuilder(new String(scriptArray));
|
||||
|
||||
if (tmpSql.length() > 0) {
|
||||
log.info("Executing script " + rs.getString(3));
|
||||
|
@ -70,12 +70,12 @@ public class ApplyMigrationScripts extends SvrProcess {
|
|||
} catch (SQLException e) {
|
||||
execOk = false;
|
||||
e.printStackTrace();
|
||||
log.saveError("Error", "Script: " + rs.getString(3) + " - "
|
||||
+ e.getMessage());
|
||||
StringBuilder msglog = new StringBuilder("Script: ").append(rs.getString(3)).append(" - ").append(e.getMessage());
|
||||
log.saveError("Error", msglog.toString());
|
||||
log.severe(e.getMessage());
|
||||
} finally {
|
||||
sql = "UPDATE ad_migrationscript SET status = ? , isApply = 'N' WHERE ad_migrationscript_id = ? ";
|
||||
pstmt = DB.prepareStatement(sql, this.get_TrxName());
|
||||
sql = new StringBuilder("UPDATE ad_migrationscript SET status = ? , isApply = 'N' WHERE ad_migrationscript_id = ? ");
|
||||
pstmt = DB.prepareStatement(sql.toString(), this.get_TrxName());
|
||||
if (execOk) {
|
||||
pstmt.setString(1, "CO");
|
||||
pstmt.setInt(2, seqID);
|
||||
|
@ -91,8 +91,8 @@ public class ApplyMigrationScripts extends SvrProcess {
|
|||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
log.saveError("Error", "Script: " + rs.getString(3) + " - "
|
||||
+ e.getMessage());
|
||||
StringBuilder msglog = new StringBuilder("Script: ").append(rs.getString(3)).append(" - ").append(e.getMessage());
|
||||
log.saveError("Error", msglog.toString());
|
||||
log.severe(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class ApplyMigrationScripts extends SvrProcess {
|
|||
|
||||
public boolean executeScript(String sql, String fileName) {
|
||||
BufferedReader reader = new BufferedReader(new StringReader(sql));
|
||||
StringBuffer sqlBuf = new StringBuffer();
|
||||
StringBuilder sqlBuf = new StringBuilder();
|
||||
String line;
|
||||
boolean statementReady = false;
|
||||
boolean execOk = true;
|
||||
|
@ -151,8 +151,9 @@ public class ApplyMigrationScripts extends SvrProcess {
|
|||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
execOk = false;
|
||||
log.saveError("Error", "Script: " + fileName + " - "
|
||||
+ e.getMessage() + ". The line that caused the error is the following ==> " + sqlBuf);
|
||||
StringBuilder msglog = new StringBuilder("Script: ").append(fileName).append(" - ")
|
||||
.append(e.getMessage()).append(". The line that caused the error is the following ==> ").append(sqlBuf);
|
||||
log.saveError("Error", msglog.toString());
|
||||
log.severe(e.getMessage());
|
||||
} finally {
|
||||
stmt.close();
|
||||
|
|
|
@ -96,7 +96,8 @@ public class ClientAcctProcessor extends SvrProcess
|
|||
*/
|
||||
protected String doIt () throws Exception
|
||||
{
|
||||
log.info("C_AcctSchema_ID=" + p_C_AcctSchema_ID + ", AD_Table_ID=" + p_AD_Table_ID);
|
||||
StringBuilder msglog = new StringBuilder("C_AcctSchema_ID=").append(p_C_AcctSchema_ID).append(", AD_Table_ID=").append(p_AD_Table_ID);
|
||||
log.info(msglog.toString());
|
||||
|
||||
if (! MClient.isClientAccounting())
|
||||
throw new AdempiereUserError(Msg.getMsg(getCtx(), "ClientAccountingNotEnabled"));
|
||||
|
@ -145,7 +146,7 @@ public class ClientAcctProcessor extends SvrProcess
|
|||
&& p_AD_Table_ID != AD_Table_ID)
|
||||
continue;
|
||||
|
||||
StringBuffer sql = new StringBuffer ("SELECT DISTINCT ProcessedOn FROM ").append(TableName)
|
||||
StringBuilder sql = new StringBuilder("SELECT DISTINCT ProcessedOn FROM ").append(TableName)
|
||||
.append(" WHERE AD_Client_ID=? AND ProcessedOn<?")
|
||||
.append(" AND Processed='Y' AND Posted='N' AND IsActive='Y'");
|
||||
PreparedStatement pstmt = null;
|
||||
|
@ -195,7 +196,7 @@ public class ClientAcctProcessor extends SvrProcess
|
|||
&& p_AD_Table_ID != AD_Table_ID)
|
||||
continue;
|
||||
// SELECT * FROM table
|
||||
StringBuffer sql = new StringBuffer ("SELECT * FROM ").append(TableName)
|
||||
StringBuilder sql = new StringBuilder("SELECT * FROM ").append(TableName)
|
||||
.append(" WHERE AD_Client_ID=? AND (ProcessedOn");
|
||||
if (processedOn.compareTo(Env.ZERO) != 0)
|
||||
sql.append("=?");
|
||||
|
@ -263,10 +264,14 @@ public class ClientAcctProcessor extends SvrProcess
|
|||
if (countError[i] > 0)
|
||||
m_summary.append("(Errors=").append(countError[i]).append(")");
|
||||
m_summary.append(" - ");
|
||||
log.finer(getName() + ": " + m_summary.toString());
|
||||
StringBuilder msglog = new StringBuilder(getName()).append(": ").append(m_summary.toString());
|
||||
log.finer(msglog.toString());
|
||||
}
|
||||
else
|
||||
log.finer(getName() + ": " + TableName + " - no work");
|
||||
{
|
||||
StringBuilder msglog = new StringBuilder(getName()).append(": ").append(TableName).append(" - no work");
|
||||
log.finer(msglog.toString());
|
||||
}
|
||||
}
|
||||
|
||||
} // postSession
|
||||
|
|
|
@ -224,9 +224,9 @@ public class ExpenseTypesFromAccounts extends SvrProcess {
|
|||
}
|
||||
}
|
||||
|
||||
String returnStr = addCount + " products added.";
|
||||
if (skipCount>0) returnStr += " " + skipCount + " products skipped.";
|
||||
return(returnStr);
|
||||
StringBuilder returnStr = new StringBuilder().append(addCount).append(" products added.");
|
||||
if (skipCount>0) returnStr.append(" ").append(skipCount).append(" products skipped.");
|
||||
return(returnStr.toString());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ public class Export extends SvrProcess
|
|||
AD_Table_ID = getTable_ID();
|
||||
|
||||
// C_Invoice; AD_Table_ID = 318
|
||||
StringBuffer sb = new StringBuffer ("AD_Table_ID=").append(AD_Table_ID);
|
||||
StringBuilder sb = new StringBuilder("AD_Table_ID=").append(AD_Table_ID);
|
||||
sb.append("; Record_ID=").append(getRecord_ID());
|
||||
// Parameter
|
||||
ProcessInfoParameter[] para = getParameter();
|
||||
|
@ -154,7 +154,7 @@ public class Export extends SvrProcess
|
|||
}
|
||||
MEXPFormat exportFormat = new MEXPFormat(getCtx(), EXP_Format_ID, get_TrxName());
|
||||
|
||||
StringBuffer sql = new StringBuffer("SELECT * ")
|
||||
StringBuilder sql = new StringBuilder("SELECT * ")
|
||||
.append("FROM ").append(table.getTableName()).append(" ")
|
||||
.append("WHERE ").append(po.get_KeyColumns()[0]).append("=?")
|
||||
;
|
||||
|
@ -270,7 +270,8 @@ public class Export extends SvrProcess
|
|||
}
|
||||
}
|
||||
}*/
|
||||
log.info("EXP Field - column=["+column.getColumnName()+"]; value=" + value);
|
||||
StringBuilder msglog = new StringBuilder("EXP Field - column=[").append(column.getColumnName()).append("]; value=").append(value);
|
||||
log.info(msglog.toString());
|
||||
if (valueString != null && !"".equals(valueString) && !"null".equals(valueString)) {
|
||||
Text newText = outDocument.createTextNode(valueString);
|
||||
newElement.appendChild(newText);
|
||||
|
@ -331,7 +332,8 @@ public class Export extends SvrProcess
|
|||
}
|
||||
}
|
||||
}*/
|
||||
log.info("EXP Field - column=["+column.getColumnName()+"]; value=" + value);
|
||||
StringBuilder msglog = new StringBuilder("EXP Field - column=[").append(column.getColumnName()).append("]; value=").append(value);
|
||||
log.info(msglog.toString());
|
||||
if (valueString != null && !"".equals(valueString) && !"null".equals(valueString)) {
|
||||
rootElement.setAttribute(formatLine.getValue(), valueString);
|
||||
elementHasValue = true;
|
||||
|
@ -348,7 +350,7 @@ public class Export extends SvrProcess
|
|||
|
||||
MTable tableEmbedded = MTable.get(getCtx(), embeddedFormat.getAD_Table_ID());
|
||||
log.info("Table Embedded = " + tableEmbedded);
|
||||
StringBuffer sql = new StringBuffer("SELECT * ")
|
||||
StringBuilder sql = new StringBuilder("SELECT * ")
|
||||
.append("FROM ").append(tableEmbedded.getTableName()).append(" ")
|
||||
.append("WHERE ").append(masterPO.get_KeyColumns()[0]).append("=?")
|
||||
//+ "WHERE " + po.get_WhereClause(false)
|
||||
|
|
|
@ -83,10 +83,10 @@ public class HouseKeeping extends SvrProcess{
|
|||
int nodel = 0;
|
||||
|
||||
if (houseKeeping.isSaveInHistoric()){
|
||||
String sql = "INSERT INTO hst_"+tableName + " SELECT * FROM " + tableName;
|
||||
StringBuilder sql = new StringBuilder("INSERT INTO hst_").append(tableName).append(" SELECT * FROM ").append(tableName);
|
||||
if (whereClause != null && whereClause.length() > 0)
|
||||
sql = sql + " WHERE " + whereClause;
|
||||
noins = DB.executeUpdate(sql, get_TrxName());
|
||||
sql.append(" WHERE ").append(whereClause);
|
||||
noins = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (noins == -1)
|
||||
throw new AdempiereSystemError("Cannot insert into hst_"+tableName);
|
||||
addLog("@Inserted@ " + noins);
|
||||
|
@ -98,15 +98,15 @@ public class HouseKeeping extends SvrProcess{
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String dateString = dateFormat.format(date);
|
||||
FileWriter file = new FileWriter(pathFile+File.separator+tableName+dateString+".xml");
|
||||
String sql = "SELECT * FROM " + tableName;
|
||||
StringBuilder sql = new StringBuilder("SELECT * FROM ").append(tableName);
|
||||
if (whereClause != null && whereClause.length() > 0)
|
||||
sql = sql + " WHERE " + whereClause;
|
||||
sql.append(" WHERE ").append(whereClause);
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
StringBuffer linexml = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement(sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next()) {
|
||||
GenericPO po = new GenericPO(tableName, getCtx(), rs, get_TrxName());
|
||||
|
@ -130,10 +130,10 @@ public class HouseKeeping extends SvrProcess{
|
|||
addLog("@Exported@ " + noexp);
|
||||
}//XmlExport
|
||||
|
||||
String sql = "DELETE FROM " + tableName;
|
||||
StringBuilder sql = new StringBuilder("DELETE FROM ").append(tableName);
|
||||
if (whereClause != null && whereClause.length() > 0)
|
||||
sql = sql + " WHERE " + whereClause;
|
||||
nodel = DB.executeUpdate(sql, get_TrxName());
|
||||
sql.append(" WHERE ").append(whereClause);
|
||||
nodel = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (nodel == -1)
|
||||
throw new AdempiereSystemError("Cannot delete from " + tableName);
|
||||
Timestamp time = new Timestamp(date.getTime());
|
||||
|
@ -141,7 +141,7 @@ public class HouseKeeping extends SvrProcess{
|
|||
houseKeeping.setLastDeleted(nodel);
|
||||
houseKeeping.saveEx();
|
||||
addLog("@Deleted@ " + nodel);
|
||||
String msg = Msg.getElement(getCtx(), tableName + "_ID") + " #" + nodel;
|
||||
return msg;
|
||||
StringBuilder msg = new StringBuilder(Msg.getElement(getCtx(), tableName + "_ID")).append(" #").append(nodel);
|
||||
return msg.toString();
|
||||
}//doIt
|
||||
}
|
||||
|
|
|
@ -114,10 +114,11 @@ public class ImmediateBankTransfer extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws Exception
|
||||
{
|
||||
log.info("From Bank="+p_From_C_BankAccount_ID+" - To Bank="+p_To_C_BankAccount_ID
|
||||
+ " - C_CashBook_ID="+p_C_CashBook_ID+" - Amount="+p_Amount+" - Name="+p_Name
|
||||
+ " - Description="+p_Description+ " - Statement Date="+p_StatementDate+
|
||||
" - Date Account="+p_DateAcct);
|
||||
StringBuilder msglog = new StringBuilder("From Bank=").append(p_From_C_BankAccount_ID).append(" - To Bank=").append(p_To_C_BankAccount_ID)
|
||||
.append(" - C_CashBook_ID=").append(p_C_CashBook_ID).append(" - Amount=").append(p_Amount).append(" - Name=").append(p_Name)
|
||||
.append(" - Description=").append(p_Description).append(" - Statement Date=").append(p_StatementDate)
|
||||
.append(" - Date Account=").append(p_DateAcct);
|
||||
log.info(msglog.toString());
|
||||
|
||||
if (p_To_C_BankAccount_ID == 0 || p_From_C_BankAccount_ID == 0)
|
||||
throw new IllegalArgumentException("Banks required");
|
||||
|
@ -248,17 +249,18 @@ public class ImmediateBankTransfer extends SvrProcess
|
|||
MCash cash = createCash();
|
||||
MCashLine cashLines[]= createCashLines(cash);
|
||||
|
||||
StringBuffer processMsg = new StringBuffer(cash.getDocumentNo());
|
||||
StringBuilder processMsg = new StringBuilder(cash.getDocumentNo());
|
||||
|
||||
cash.setDocAction(p_docAction);
|
||||
if (!cash.processIt(p_docAction))
|
||||
{
|
||||
processMsg.append(" (NOT Processed)");
|
||||
log.warning("Cash Processing failed: " + cash + " - " + cash.getProcessMsg());
|
||||
addLog(cash.getC_Cash_ID(), cash.getStatementDate(), null,
|
||||
"Cash Processing failed: " + cash + " - "
|
||||
+ cash.getProcessMsg()
|
||||
+ " / please complete it manually");
|
||||
StringBuilder msglog = new StringBuilder("Cash Processing failed: ").append(cash).append(" - ").append(cash.getProcessMsg());
|
||||
log.warning(msglog.toString());
|
||||
msglog = new StringBuilder("Cash Processing failed: ").append(cash).append(" - ")
|
||||
.append(cash.getProcessMsg())
|
||||
.append(" / please complete it manually");
|
||||
addLog(cash.getC_Cash_ID(), cash.getStatementDate(), null,msglog.toString());
|
||||
throw new IllegalStateException("Cash Processing failed: " + cash + " - " + cash.getProcessMsg());
|
||||
}
|
||||
if (!cash.save())
|
||||
|
|
|
@ -88,9 +88,9 @@ public class ImportPriceList extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws Exception
|
||||
{
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID);
|
||||
|
||||
int m_discountschema_id = DB.getSQLValue(get_TrxName(),
|
||||
"SELECT MIN(M_DiscountSchema_ID) FROM M_DiscountSchema WHERE DiscountType='P' AND IsActive='Y' AND AD_Client_ID=?",
|
||||
|
@ -103,81 +103,81 @@ public class ImportPriceList extends SvrProcess
|
|||
// Delete Old Imported
|
||||
if (m_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_PriceList "
|
||||
sql = new StringBuilder("DELETE I_PriceList "
|
||||
+ "WHERE I_IsImported='Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IsActive, Created/Updated, EnforcePriceLimit, IsSOPriceList, IsTaxIncluded, PricePrecision
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID, 0),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " EnforcePriceLimit = COALESCE (EnforcePriceLimit, 'N'),"
|
||||
+ " IsSOPriceList = COALESCE (IsSOPriceList, 'N'),"
|
||||
+ " IsTaxIncluded = COALESCE (IsTaxIncluded, 'N'),"
|
||||
+ " PricePrecision = COALESCE (PricePrecision, 2),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder("UPDATE I_PriceList ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),")
|
||||
.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" EnforcePriceLimit = COALESCE (EnforcePriceLimit, 'N'),")
|
||||
.append(" IsSOPriceList = COALESCE (IsSOPriceList, 'N'),")
|
||||
.append(" IsTaxIncluded = COALESCE (IsTaxIncluded, 'N'),")
|
||||
.append(" PricePrecision = COALESCE (PricePrecision, 2),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Reset=" + no);
|
||||
|
||||
// Set Optional BPartner
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p"
|
||||
+ " WHERE I_PriceList.BPartner_Value=p.Value AND I_PriceList.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p")
|
||||
.append(" WHERE I_PriceList.BPartner_Value=p.Value AND I_PriceList.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("BPartner=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner,' "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner,' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid BPartner=" + no);
|
||||
|
||||
// Product
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE I_PriceList.ProductValue=p.Value AND I_PriceList.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_PriceList ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE I_PriceList.ProductValue=p.Value AND I_PriceList.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Product from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' "
|
||||
+ "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' ")
|
||||
.append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Product=" + no);
|
||||
|
||||
// **** Find Price List
|
||||
// Name
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET M_PriceList_ID=(SELECT M_PriceList_ID FROM M_PriceList p"
|
||||
+ " WHERE I_PriceList.Name=p.Name AND I_PriceList.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET M_PriceList_ID=(SELECT M_PriceList_ID FROM M_PriceList p")
|
||||
.append(" WHERE I_PriceList.Name=p.Name AND I_PriceList.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Price List Existing Value=" + no);
|
||||
|
||||
// **** Find Price List Version
|
||||
// List Name (ID) + ValidFrom
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET M_PriceList_Version_ID=(SELECT M_PriceList_Version_ID FROM M_PriceList_Version p"
|
||||
+ " WHERE I_PriceList.ValidFrom=p.ValidFrom AND I_PriceList.M_PriceList_ID=p.M_PriceList_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NOT NULL AND M_PriceList_Version_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET M_PriceList_Version_ID=(SELECT M_PriceList_Version_ID FROM M_PriceList_Version p")
|
||||
.append(" WHERE I_PriceList.ValidFrom=p.ValidFrom AND I_PriceList.M_PriceList_ID=p.M_PriceList_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NOT NULL AND M_PriceList_Version_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Price List Version Existing Value=" + no);
|
||||
|
||||
|
@ -208,55 +208,55 @@ public class ImportPriceList extends SvrProcess
|
|||
*/
|
||||
|
||||
// Set Currency
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET ISO_Code=(SELECT ISO_Code FROM C_Currency c"
|
||||
+ " INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)"
|
||||
+ " INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)"
|
||||
+ " WHERE ci.AD_Client_ID=I_PriceList.AD_Client_ID) "
|
||||
+ "WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_PriceList ")
|
||||
.append("SET ISO_Code=(SELECT ISO_Code FROM C_Currency c")
|
||||
.append(" INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)")
|
||||
.append(" INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)")
|
||||
.append(" WHERE ci.AD_Client_ID=I_PriceList.AD_Client_ID) ")
|
||||
.append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Currency Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE I_PriceList.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,I_PriceList.AD_Client_ID)) "
|
||||
+ "WHERE C_Currency_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c")
|
||||
.append(" WHERE I_PriceList.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,I_PriceList.AD_Client_ID)) ")
|
||||
.append("WHERE C_Currency_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("doIt- Set Currency=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' "
|
||||
+ "WHERE C_Currency_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' ")
|
||||
.append("WHERE C_Currency_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid Currency=" + no);
|
||||
|
||||
// Mandatory Name or PriceListID
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Mandatory Name or PriceListID,' "
|
||||
+ "WHERE Name IS NULL AND M_PriceList_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Mandatory Name or PriceListID,' ")
|
||||
.append("WHERE Name IS NULL AND M_PriceList_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No Mandatory Name=" + no);
|
||||
|
||||
// Mandatory ValidFrom or PriceListVersionID
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Mandatory ValidFrom or PriceListVersionID,' "
|
||||
+ "WHERE ValidFrom IS NULL AND M_PriceList_Version_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Mandatory ValidFrom or PriceListVersionID,' ")
|
||||
.append("WHERE ValidFrom IS NULL AND M_PriceList_Version_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No Mandatory ValidFrom=" + no);
|
||||
|
||||
// Mandatory BreakValue if BPartner set
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory BreakValue,' "
|
||||
+ "WHERE BreakValue IS NULL AND (C_BPartner_ID IS NOT NULL OR BPartner_Value IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory BreakValue,' ")
|
||||
.append("WHERE BreakValue IS NULL AND (C_BPartner_ID IS NOT NULL OR BPartner_Value IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No Mandatory BreakValue=" + no);
|
||||
|
@ -273,7 +273,7 @@ public class ImportPriceList extends SvrProcess
|
|||
|
||||
// Go through Records
|
||||
log.fine("start inserting/updating ...");
|
||||
sql = new StringBuffer ("SELECT * FROM I_PriceList WHERE I_IsImported='N'")
|
||||
sql = new StringBuilder ("SELECT * FROM I_PriceList WHERE I_IsImported='N'")
|
||||
.append(clientCheck);
|
||||
PreparedStatement pstmt_setImported = null;
|
||||
PreparedStatement pstmt = null;
|
||||
|
@ -300,7 +300,8 @@ public class ImportPriceList extends SvrProcess
|
|||
M_PriceList_ID = 0;
|
||||
}
|
||||
boolean newPriceList = M_PriceList_ID == 0;
|
||||
log.fine("I_PriceList_ID=" + I_PriceList_ID + ", M_PriceList_ID=" + M_PriceList_ID);
|
||||
StringBuilder msglog = new StringBuilder("I_PriceList_ID=").append(I_PriceList_ID).append(", M_PriceList_ID=").append(M_PriceList_ID);
|
||||
log.fine(msglog.toString());
|
||||
|
||||
MPriceList pricelist = null;
|
||||
// PriceList
|
||||
|
@ -315,8 +316,8 @@ public class ImportPriceList extends SvrProcess
|
|||
}
|
||||
else
|
||||
{
|
||||
StringBuffer sql0 = new StringBuffer ("UPDATE I_PriceList i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Price List failed"))
|
||||
StringBuilder sql0 = new StringBuilder ("UPDATE I_PriceList i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Price List failed"))
|
||||
.append("WHERE I_PriceList_ID=").append(I_PriceList_ID);
|
||||
DB.executeUpdate(sql0.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -334,7 +335,8 @@ public class ImportPriceList extends SvrProcess
|
|||
M_PriceList_Version_ID = 0;
|
||||
}
|
||||
boolean newPriceListVersion = M_PriceList_Version_ID == 0;
|
||||
log.fine("I_PriceList_ID=" + I_PriceList_ID + ", M_PriceList_Version_ID=" + M_PriceList_Version_ID);
|
||||
msglog = new StringBuilder("I_PriceList_ID=").append(I_PriceList_ID).append(", M_PriceList_Version_ID=").append(M_PriceList_Version_ID);
|
||||
log.fine(msglog.toString());
|
||||
|
||||
MPriceListVersion pricelistversion = null;
|
||||
// PriceListVersion
|
||||
|
@ -352,8 +354,8 @@ public class ImportPriceList extends SvrProcess
|
|||
}
|
||||
else
|
||||
{
|
||||
StringBuffer sql0 = new StringBuffer ("UPDATE I_PriceList i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Price List Version failed"))
|
||||
StringBuilder sql0 = new StringBuilder ("UPDATE I_PriceList i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Price List Version failed"))
|
||||
.append("WHERE I_PriceList_ID=").append(I_PriceList_ID);
|
||||
DB.executeUpdate(sql0.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -401,8 +403,8 @@ public class ImportPriceList extends SvrProcess
|
|||
}
|
||||
else
|
||||
{
|
||||
StringBuffer sql0 = new StringBuffer ("UPDATE I_PriceList i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert/Update Product Price Vendor Break Version failed"))
|
||||
StringBuilder sql0 = new StringBuilder ("UPDATE I_PriceList i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert/Update Product Price Vendor Break Version failed"))
|
||||
.append("WHERE I_PriceList_ID=").append(I_PriceList_ID);
|
||||
DB.executeUpdate(sql0.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -432,8 +434,8 @@ public class ImportPriceList extends SvrProcess
|
|||
}
|
||||
else
|
||||
{
|
||||
StringBuffer sql0 = new StringBuffer ("UPDATE I_PriceList i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert/Update Product Price failed"))
|
||||
StringBuilder sql0 = new StringBuilder ("UPDATE I_PriceList i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert/Update Product Price failed"))
|
||||
.append("WHERE I_PriceList_ID=").append(I_PriceList_ID);
|
||||
DB.executeUpdate(sql0.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -460,9 +462,9 @@ public class ImportPriceList extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_PriceList "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PriceList ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
addLog (0, null, new BigDecimal (noInsertpl), "@M_PriceList_ID@: @Inserted@");
|
||||
|
|
|
@ -236,8 +236,9 @@ public class InOutGenerateRMA extends SvrProcess
|
|||
|
||||
if (shipmentLines.length == 0)
|
||||
{
|
||||
log.log(Level.WARNING, "No shipment lines created: M_RMA_ID="
|
||||
+ M_RMA_ID + ", M_InOut_ID=" + shipment.get_ID());
|
||||
StringBuilder msglog = new StringBuilder("No shipment lines created: M_RMA_ID=")
|
||||
.append(M_RMA_ID).append(", M_InOut_ID=").append(shipment.get_ID());
|
||||
log.log(Level.WARNING, msglog.toString());
|
||||
}
|
||||
|
||||
StringBuffer processMsg = new StringBuffer(shipment.getDocumentNo());
|
||||
|
@ -245,7 +246,8 @@ public class InOutGenerateRMA extends SvrProcess
|
|||
if (!shipment.processIt(p_docAction))
|
||||
{
|
||||
processMsg.append(" (NOT Processed)");
|
||||
log.warning("Shipment Processing failed: " + shipment + " - " + shipment.getProcessMsg());
|
||||
StringBuilder msglog = new StringBuilder("Shipment Processing failed: ").append(shipment).append(" - ").append(shipment.getProcessMsg());
|
||||
log.warning(msglog.toString());
|
||||
throw new IllegalStateException("Shipment Processing failed: " + shipment + " - " + shipment.getProcessMsg());
|
||||
}
|
||||
|
||||
|
|
|
@ -149,24 +149,26 @@ public class InitialClientSetup extends SvrProcess
|
|||
*/
|
||||
protected String doIt () throws Exception
|
||||
{
|
||||
log.info("InitialClientSetup"
|
||||
+ ": ClientName=" + p_ClientName
|
||||
+ ", OrgValue=" + p_OrgValue
|
||||
+ ", OrgName=" + p_OrgName
|
||||
+ ", AdminUserName=" + p_AdminUserName
|
||||
+ ", NormalUserName=" + p_NormalUserName
|
||||
+ ", C_Currency_ID=" + p_C_Currency_ID
|
||||
+ ", C_Country_ID=" + p_C_Country_ID
|
||||
+ ", C_Region_ID=" + p_C_Region_ID
|
||||
+ ", CityName=" + p_CityName
|
||||
+ ", C_City_ID=" + p_C_City_ID
|
||||
+ ", IsUseBPDimension=" + p_IsUseBPDimension
|
||||
+ ", IsUseProductDimension=" + p_IsUseProductDimension
|
||||
+ ", IsUseProjectDimension=" + p_IsUseProjectDimension
|
||||
+ ", IsUseCampaignDimension=" + p_IsUseCampaignDimension
|
||||
+ ", IsUseSalesRegionDimension=" + p_IsUseSalesRegionDimension
|
||||
+ ", CoAFile=" + p_CoAFile
|
||||
);
|
||||
|
||||
StringBuilder msglog = new StringBuilder("InitialClientSetup")
|
||||
.append(": ClientName=").append(p_ClientName)
|
||||
.append(", OrgValue=").append(p_OrgValue)
|
||||
.append(", OrgName=").append(p_OrgName)
|
||||
.append(", AdminUserName=").append(p_AdminUserName)
|
||||
.append(", NormalUserName=").append(p_NormalUserName)
|
||||
.append(", C_Currency_ID=").append(p_C_Currency_ID)
|
||||
.append(", C_Country_ID=").append(p_C_Country_ID)
|
||||
.append(", C_Region_ID=").append(p_C_Region_ID)
|
||||
.append(", CityName=").append(p_CityName)
|
||||
.append(", C_City_ID=").append(p_C_City_ID)
|
||||
.append(", IsUseBPDimension=").append(p_IsUseBPDimension)
|
||||
.append(", IsUseProductDimension=").append(p_IsUseProductDimension)
|
||||
.append(", IsUseProjectDimension=").append(p_IsUseProjectDimension)
|
||||
.append(", IsUseCampaignDimension=").append(p_IsUseCampaignDimension)
|
||||
.append(", IsUseSalesRegionDimension=").append(p_IsUseSalesRegionDimension)
|
||||
.append(", CoAFile=").append(p_CoAFile);
|
||||
|
||||
log.info(msglog.toString());
|
||||
|
||||
// Validations
|
||||
|
||||
|
@ -196,7 +198,8 @@ public class InitialClientSetup extends SvrProcess
|
|||
if (p_C_City_ID > 0) {
|
||||
MCity city = MCity.get(getCtx(), p_C_City_ID);
|
||||
if (! city.getName().equals(p_CityName)) {
|
||||
log.info("City name changed from " + p_CityName + " to " + city.getName());
|
||||
msglog = new StringBuilder("City name changed from ").append(p_CityName).append(" to ").append(city.getName());
|
||||
log.info(msglog.toString());
|
||||
p_CityName = city.getName();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,8 +165,9 @@ public class InvoiceGenerateRMA extends SvrProcess
|
|||
{
|
||||
if (rmaLine.getM_InOutLine_ID() == 0)
|
||||
{
|
||||
throw new IllegalStateException("No customer return line - RMA = "
|
||||
+ rma.getDocumentNo() + ", Line = " + rmaLine.getLine());
|
||||
StringBuilder msgiste = new StringBuilder("No customer return line - RMA = ")
|
||||
.append(rma.getDocumentNo()).append(", Line = ").append(rmaLine.getLine());
|
||||
throw new IllegalStateException(msgiste.toString());
|
||||
}
|
||||
|
||||
MInvoiceLine invLine = new MInvoiceLine(invoice);
|
||||
|
@ -197,17 +198,19 @@ public class InvoiceGenerateRMA extends SvrProcess
|
|||
|
||||
if (invoiceLines.length == 0)
|
||||
{
|
||||
log.log(Level.WARNING, "No invoice lines created: M_RMA_ID="
|
||||
+ M_RMA_ID + ", M_Invoice_ID=" + invoice.get_ID());
|
||||
StringBuilder msglog = new StringBuilder("No invoice lines created: M_RMA_ID=")
|
||||
.append(M_RMA_ID).append(", M_Invoice_ID=").append(invoice.get_ID());
|
||||
log.log(Level.WARNING, msglog.toString());
|
||||
}
|
||||
|
||||
StringBuffer processMsg = new StringBuffer(invoice.getDocumentNo());
|
||||
StringBuilder processMsg = new StringBuilder(invoice.getDocumentNo());
|
||||
|
||||
if (!invoice.processIt(p_docAction))
|
||||
{
|
||||
processMsg.append(" (NOT Processed)");
|
||||
log.warning("Invoice Processing failed: " + invoice + " - " + invoice.getProcessMsg());
|
||||
throw new IllegalStateException("Invoice Processing failed: " + invoice + " - " + invoice.getProcessMsg());
|
||||
StringBuilder msg = new StringBuilder("Invoice Processing failed: ").append(invoice).append(" - ").append(invoice.getProcessMsg());
|
||||
log.warning(msg.toString());
|
||||
throw new IllegalStateException(msg.toString());
|
||||
}
|
||||
|
||||
if (!invoice.save())
|
||||
|
@ -216,7 +219,8 @@ public class InvoiceGenerateRMA extends SvrProcess
|
|||
}
|
||||
|
||||
// Add processing information to process log
|
||||
addLog(invoice.getC_Invoice_ID(), invoice.getDateInvoiced(), null, processMsg.toString(),invoice.get_Table_ID(),invoice.getC_Invoice_ID());
|
||||
String message = Msg.parseTranslation(getCtx(), "@InvoiceProcessed@ " + processMsg.toString());
|
||||
addLog(invoice.getC_Invoice_ID(), invoice.getDateInvoiced(), null, message, invoice.get_Table_ID(), invoice.getC_Invoice_ID());
|
||||
m_created++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,18 +72,19 @@ public class PrepareMigrationScripts extends SvrProcess {
|
|||
};
|
||||
dirList = dir.listFiles(filter);
|
||||
|
||||
log.info("Searching for SQL files in the " + dir + " directory");
|
||||
StringBuilder msglog = new StringBuilder("Searching for SQL files in the ").append(dir).append(" directory");
|
||||
log.info(msglog.toString());
|
||||
|
||||
String msg = "";
|
||||
StringBuilder msg = new StringBuilder();
|
||||
|
||||
// Get Filenames
|
||||
for (int i = 0; i < dirList.length; i++) {
|
||||
fileName.add(dirList[i].toString()
|
||||
.substring(directory.length() + 1));
|
||||
log
|
||||
.fine("Found file ["
|
||||
+ fileName.get(i)
|
||||
+ "]. Finding out if the script has or hasn't been applied yet...");
|
||||
msglog = new StringBuilder("Found file [")
|
||||
.append(fileName.get(i))
|
||||
.append("]. Finding out if the script has or hasn't been applied yet...");
|
||||
log.fine(msglog.toString());
|
||||
try {
|
||||
// First of all, check if the script hasn't been applied yet...
|
||||
String checkScript = "select ad_migrationscript_id from ad_migrationscript where name = ?";
|
||||
|
@ -92,15 +93,16 @@ public class PrepareMigrationScripts extends SvrProcess {
|
|||
pstmt.setString(1, fileName.get(i));
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
if (rs.next()) {
|
||||
log.warning("Script " + fileName.get(i)
|
||||
+ " already in the database");
|
||||
msglog = new StringBuilder("Script ").append(fileName.get(i))
|
||||
.append(" already in the database");
|
||||
log.warning(msglog.toString());
|
||||
pstmt.close();
|
||||
continue;
|
||||
}
|
||||
pstmt.close();
|
||||
// first use a Scanner to get each line
|
||||
Scanner scanner = new Scanner(dirList[i]);
|
||||
StringBuffer body = new StringBuffer();
|
||||
StringBuilder body = new StringBuilder();
|
||||
boolean blHeader = false;
|
||||
boolean blBody = false;
|
||||
boolean isFirstLine = true;
|
||||
|
@ -215,8 +217,9 @@ public class PrepareMigrationScripts extends SvrProcess {
|
|||
if (result > 0)
|
||||
log.info("Header inserted. Now inserting the script body");
|
||||
else {
|
||||
log.severe("Script " + fileName.get(i) + " failed!");
|
||||
msg = msg + "Script " + fileName.get(i) + " failed!";
|
||||
msglog = new StringBuilder("Script ").append(fileName.get(i)).append(" failed!");
|
||||
log.severe(msglog.toString());
|
||||
msg.append(msglog);
|
||||
continue;
|
||||
}
|
||||
sql = "UPDATE AD_MigrationScript SET script = ? WHERE AD_MigrationScript_ID = ?";
|
||||
|
@ -228,8 +231,9 @@ public class PrepareMigrationScripts extends SvrProcess {
|
|||
if (result > 0)
|
||||
log.info("Script Body inserted.");
|
||||
else {
|
||||
log.severe("Script Body " + fileName.get(i) + " failed!");
|
||||
msg = msg + "Script Body " + fileName.get(i) + " failed!";
|
||||
msglog = new StringBuilder("Script Body ").append(fileName.get(i)).append(" failed!");
|
||||
log.severe(msglog.toString());
|
||||
msg.append(msglog.toString());
|
||||
pstmt = DB
|
||||
.prepareStatement(
|
||||
"DELETE FROM ad_migrationscript WHERE ad_migrationscript_id = ?",
|
||||
|
|
|
@ -38,9 +38,9 @@ public class UpdateRoleMenu extends SvrProcess
|
|||
|
||||
private MRoleMenu addUpdateRole(Properties ctx, int roleId, int menuId, boolean active, String trxName)
|
||||
{
|
||||
String whereClause = "AD_Role_ID=" + roleId + " AND U_WebMenu_ID=" + menuId;
|
||||
StringBuilder whereClause = new StringBuilder("AD_Role_ID=").append(roleId).append(" AND U_WebMenu_ID=").append(menuId);
|
||||
|
||||
int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, trxName);
|
||||
int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause.toString(), trxName);
|
||||
|
||||
|
||||
MRoleMenu roleMenu;
|
||||
|
|
|
@ -108,8 +108,8 @@ public class LanguageMaintenance extends SvrProcess
|
|||
m_language.saveEx();
|
||||
}
|
||||
}
|
||||
|
||||
return "@Deleted@=" + deleteNo + " - @Inserted@=" + insertNo;
|
||||
StringBuilder msgreturn = new StringBuilder("@Deleted@=").append(deleteNo).append(" - @Inserted@=").append(insertNo);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
|
||||
|
|
|
@ -61,21 +61,21 @@ public class AD_PrintPaper_Default extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws Exception
|
||||
{
|
||||
StringBuffer sql = new StringBuffer("");
|
||||
StringBuilder sql = new StringBuilder();
|
||||
int cnt = 0;
|
||||
|
||||
log.info("Set Print Format");
|
||||
|
||||
try
|
||||
{
|
||||
sql.append("UPDATE AD_PrintFormat pf "
|
||||
+ "SET AD_PrintPaper_ID = " + p_Record_ID + " "
|
||||
+ "WHERE EXISTS (SELECT * FROM AD_PrintPaper pp "
|
||||
+ "WHERE pf.AD_PrintPaper_ID=pp.AD_PrintPaper_ID "
|
||||
+ "AND IsLandscape = (SELECT IsLandscape FROM AD_PrintPaper "
|
||||
+ "WHERE AD_PrintPaper_ID=" + p_Record_ID + "))");
|
||||
sql.append("UPDATE AD_PrintFormat pf ")
|
||||
.append("SET AD_PrintPaper_ID = ").append(p_Record_ID).append(" ")
|
||||
.append("WHERE EXISTS (SELECT * FROM AD_PrintPaper pp ")
|
||||
.append("WHERE pf.AD_PrintPaper_ID=pp.AD_PrintPaper_ID ")
|
||||
.append("AND IsLandscape = (SELECT IsLandscape FROM AD_PrintPaper ")
|
||||
.append("WHERE AD_PrintPaper_ID=").append(p_Record_ID).append("))");
|
||||
if (p_AD_Client_ID != -1) {
|
||||
sql.append(" AND AD_Client_ID = " + p_AD_Client_ID);
|
||||
sql.append(" AND AD_Client_ID = ").append(p_AD_Client_ID);
|
||||
}
|
||||
cnt = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Updated " + cnt + " columns");
|
||||
|
|
|
@ -76,7 +76,7 @@ public class AcctSchemaDefaultCopy extends SvrProcess
|
|||
if (acct == null || acct.get_ID() == 0)
|
||||
throw new AdempiereSystemError("Default Not Found - C_AcctSchema_ID=" + p_C_AcctSchema_ID);
|
||||
|
||||
String sql = null;
|
||||
StringBuilder sql;
|
||||
int updated = 0;
|
||||
int created = 0;
|
||||
int updatedTotal = 0;
|
||||
|
@ -85,88 +85,73 @@ public class AcctSchemaDefaultCopy extends SvrProcess
|
|||
// Update existing Product Category
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE M_Product_Category_Acct pa "
|
||||
+ "SET P_Revenue_Acct=" + acct.getP_Revenue_Acct()
|
||||
+ ", P_Expense_Acct=" + acct.getP_Expense_Acct()
|
||||
+ ", P_CostAdjustment_Acct=" + acct.getP_CostAdjustment_Acct()
|
||||
+ ", P_InventoryClearing_Acct=" + acct.getP_InventoryClearing_Acct()
|
||||
+ ", P_Asset_Acct=" + acct.getP_Asset_Acct()
|
||||
+ ", P_COGS_Acct=" + acct.getP_COGS_Acct()
|
||||
+ ", P_PurchasePriceVariance_Acct=" + acct.getP_PurchasePriceVariance_Acct()
|
||||
+ ", P_InvoicePriceVariance_Acct=" + acct.getP_InvoicePriceVariance_Acct()
|
||||
+ ", P_AverageCostVariance_Acct=" + acct.getP_AverageCostVariance_Acct()
|
||||
+ ", P_TradeDiscountRec_Acct=" + acct.getP_TradeDiscountRec_Acct()
|
||||
+ ", P_TradeDiscountGrant_Acct=" + acct.getP_TradeDiscountGrant_Acct()
|
||||
+ ", P_WIP_Acct=" + acct.getP_WIP_Acct()
|
||||
+ ", P_FloorStock_Acct=" + acct.getP_FloorStock_Acct()
|
||||
+ ", P_MethodChangeVariance_Acct=" + acct.getP_MethodChangeVariance_Acct()
|
||||
+ ", P_UsageVariance_Acct=" + acct.getP_UsageVariance_Acct()
|
||||
+ ", P_RateVariance_Acct=" + acct.getP_RateVariance_Acct()
|
||||
+ ", P_MixVariance_Acct=" + acct.getP_MixVariance_Acct()
|
||||
+ ", P_Labor_Acct=" + acct.getP_Labor_Acct()
|
||||
+ ", P_Burden_Acct=" + acct.getP_Burden_Acct()
|
||||
+ ", P_CostOfProduction_Acct=" + acct.getP_CostOfProduction_Acct()
|
||||
+ ", P_OutsideProcessing_Acct=" + acct.getP_OutsideProcessing_Acct()
|
||||
+ ", P_Overhead_Acct=" + acct.getP_Overhead_Acct()
|
||||
+ ", P_Scrap_Acct=" + acct.getP_Scrap_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE pa.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM M_Product_Category p "
|
||||
+ "WHERE p.M_Product_Category_ID=pa.M_Product_Category_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE M_Product_Category_Acct pa ")
|
||||
.append("SET P_Revenue_Acct=").append(acct.getP_Revenue_Acct())
|
||||
.append(", P_Expense_Acct=").append(acct.getP_Expense_Acct())
|
||||
.append(", P_CostAdjustment_Acct=").append(acct.getP_CostAdjustment_Acct())
|
||||
.append(", P_InventoryClearing_Acct=").append(acct.getP_InventoryClearing_Acct())
|
||||
.append(", P_Asset_Acct=").append(acct.getP_Asset_Acct())
|
||||
.append(", P_COGS_Acct=").append(acct.getP_COGS_Acct())
|
||||
.append(", P_PurchasePriceVariance_Acct=").append(acct.getP_PurchasePriceVariance_Acct())
|
||||
.append(", P_InvoicePriceVariance_Acct=").append(acct.getP_InvoicePriceVariance_Acct())
|
||||
.append(", P_AverageCostVariance_Acct=").append(acct.getP_AverageCostVariance_Acct())
|
||||
.append(", P_TradeDiscountRec_Acct=").append(acct.getP_TradeDiscountRec_Acct())
|
||||
.append(", P_TradeDiscountGrant_Acct=").append(acct.getP_TradeDiscountGrant_Acct())
|
||||
.append(", P_RateVariance_Acct=").append(acct.getP_RateVariance_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE pa.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM M_Product_Category p ")
|
||||
.append("WHERE p.M_Product_Category_ID=pa.M_Product_Category_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @M_Product_Category_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new Product Category
|
||||
sql = "INSERT INTO M_Product_Category_Acct "
|
||||
+ "(M_Product_Category_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,"
|
||||
+ " P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,"
|
||||
+ " P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct,"
|
||||
+ " P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,"
|
||||
+ " P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct) "
|
||||
+ " SELECT p.M_Product_Category_ID, acct.C_AcctSchema_ID,"
|
||||
+ " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,"
|
||||
+ " acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,"
|
||||
+ " acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct,"
|
||||
+ " acct.P_WIP_Acct,acct.P_FloorStock_Acct,acct.P_MethodChangeVariance_Acct,acct.P_UsageVariance_Acct,acct.P_RateVariance_Acct,"
|
||||
+ " acct.P_MixVariance_Acct,acct.P_Labor_Acct,acct.P_Burden_Acct,acct.P_CostOfProduction_Acct,acct.P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct "
|
||||
+ "FROM M_Product_Category p"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (p.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM M_Product_Category_Acct pa "
|
||||
+ "WHERE pa.M_Product_Category_ID=p.M_Product_Category_ID"
|
||||
+ " AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO M_Product_Category_Acct ")
|
||||
.append("(M_Product_Category_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,")
|
||||
.append(" P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,")
|
||||
.append(" P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct," )
|
||||
.append(" P_RateVariance_Acct) ")
|
||||
.append(" SELECT p.M_Product_Category_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,")
|
||||
.append(" acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,")
|
||||
.append(" acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct,")
|
||||
.append(" acct.P_RateVariance_Acct ")
|
||||
.append("FROM M_Product_Category p")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (p.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM M_Product_Category_Acct pa ")
|
||||
.append("WHERE pa.M_Product_Category_ID=p.M_Product_Category_ID")
|
||||
.append(" AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @M_Product_Category_ID@");
|
||||
createdTotal += created;
|
||||
if (!p_CopyOverwriteAcct) // Insert new Products
|
||||
{
|
||||
sql = "INSERT INTO M_Product_Acct "
|
||||
+ "(M_Product_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,"
|
||||
+ " P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,"
|
||||
+ " P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, "
|
||||
+ " P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct,"
|
||||
+ " P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct) "
|
||||
+ "SELECT p.M_Product_ID, acct.C_AcctSchema_ID,"
|
||||
+ " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,"
|
||||
+ " acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,"
|
||||
+ " acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct,"
|
||||
+ " acct.P_WIP_Acct,acct.P_FloorStock_Acct,acct.P_MethodChangeVariance_Acct,acct.P_UsageVariance_Acct,acct.P_RateVariance_Acct,"
|
||||
+ " acct.P_MixVariance_Acct,acct.P_Labor_Acct,acct.P_Burden_Acct,acct.P_CostOfProduction_Acct,acct.P_OutsideProcessing_Acct,acct.P_Overhead_Acct,acct.P_Scrap_Acct "
|
||||
+ "FROM M_Product p"
|
||||
+ " INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)"
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND p.M_Product_Category_ID=acct.M_Product_Category_ID"
|
||||
+ " AND NOT EXISTS (SELECT * FROM M_Product_Acct pa "
|
||||
+ "WHERE pa.M_Product_ID=p.M_Product_ID"
|
||||
+ " AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO M_Product_Acct ")
|
||||
.append("(M_Product_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct,")
|
||||
.append(" P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_AverageCostVariance_Acct,")
|
||||
.append(" P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, ")
|
||||
.append(" P_RateVariance_Acct) ")
|
||||
.append("SELECT p.M_Product_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct,")
|
||||
.append(" acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_AverageCostVariance_Acct,")
|
||||
.append(" acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct,")
|
||||
.append(" acct.P_RateVariance_Acct ")
|
||||
.append("FROM M_Product p")
|
||||
.append(" INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND p.M_Product_Category_ID=acct.M_Product_Category_ID")
|
||||
.append(" AND NOT EXISTS (SELECT * FROM M_Product_Acct pa ")
|
||||
.append("WHERE pa.M_Product_ID=p.M_Product_ID")
|
||||
.append(" AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @M_Product_ID@");
|
||||
createdTotal += created;
|
||||
}
|
||||
|
@ -175,156 +160,151 @@ public class AcctSchemaDefaultCopy extends SvrProcess
|
|||
// Update Business Partner Group
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE C_BP_Group_Acct a "
|
||||
+ "SET C_Receivable_Acct=" + acct.getC_Receivable_Acct()
|
||||
+ ", C_Receivable_Services_Acct=" + acct.getC_Receivable_Services_Acct()
|
||||
+ ", C_Prepayment_Acct=" + acct.getC_Prepayment_Acct()
|
||||
+ ", V_Liability_Acct=" + acct.getV_Liability_Acct()
|
||||
+ ", V_Liability_Services_Acct=" + acct.getV_Liability_Services_Acct()
|
||||
+ ", V_Prepayment_Acct=" + acct.getV_Prepayment_Acct()
|
||||
+ ", PayDiscount_Exp_Acct=" + acct.getPayDiscount_Exp_Acct()
|
||||
+ ", PayDiscount_Rev_Acct=" + acct.getPayDiscount_Rev_Acct()
|
||||
+ ", WriteOff_Acct=" + acct.getWriteOff_Acct()
|
||||
+ ", NotInvoicedReceipts_Acct=" + acct.getNotInvoicedReceipts_Acct()
|
||||
+ ", UnEarnedRevenue_Acct=" + acct.getUnEarnedRevenue_Acct()
|
||||
+ ", NotInvoicedRevenue_Acct=" + acct.getNotInvoicedRevenue_Acct()
|
||||
+ ", NotInvoicedReceivables_Acct=" + acct.getNotInvoicedReceivables_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM C_BP_Group_Acct x "
|
||||
+ "WHERE x.C_BP_Group_ID=a.C_BP_Group_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE C_BP_Group_Acct a ")
|
||||
.append("SET C_Receivable_Acct=").append(acct.getC_Receivable_Acct())
|
||||
.append(", C_Receivable_Services_Acct=").append(acct.getC_Receivable_Services_Acct())
|
||||
.append(", C_Prepayment_Acct=").append(acct.getC_Prepayment_Acct())
|
||||
.append(", V_Liability_Acct=").append(acct.getV_Liability_Acct())
|
||||
.append(", V_Liability_Services_Acct=").append(acct.getV_Liability_Services_Acct())
|
||||
.append(", V_Prepayment_Acct=").append(acct.getV_Prepayment_Acct())
|
||||
.append(", PayDiscount_Exp_Acct=").append(acct.getPayDiscount_Exp_Acct())
|
||||
.append(", PayDiscount_Rev_Acct=").append(acct.getPayDiscount_Rev_Acct())
|
||||
.append(", WriteOff_Acct=").append(acct.getWriteOff_Acct())
|
||||
.append(", NotInvoicedReceipts_Acct=").append(acct.getNotInvoicedReceipts_Acct())
|
||||
.append(", UnEarnedRevenue_Acct=").append(acct.getUnEarnedRevenue_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM C_BP_Group_Acct x ")
|
||||
.append("WHERE x.C_BP_Group_ID=a.C_BP_Group_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_BP_Group_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert Business Partner Group
|
||||
sql = "INSERT INTO C_BP_Group_Acct "
|
||||
+ "(C_BP_Group_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct,"
|
||||
+ " V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct,"
|
||||
+ " PayDiscount_Exp_Acct, PayDiscount_Rev_Acct, WriteOff_Acct,"
|
||||
+ " NotInvoicedReceipts_Acct, UnEarnedRevenue_Acct,"
|
||||
+ " NotInvoicedRevenue_Acct, NotInvoicedReceivables_Acct) "
|
||||
+ "SELECT x.C_BP_Group_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct,"
|
||||
+ " acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct,"
|
||||
+ " acct.PayDiscount_Exp_Acct, acct.PayDiscount_Rev_Acct, acct.WriteOff_Acct,"
|
||||
+ " acct.NotInvoicedReceipts_Acct, acct.UnEarnedRevenue_Acct,"
|
||||
+ " acct.NotInvoicedRevenue_Acct, acct.NotInvoicedReceivables_Acct "
|
||||
+ "FROM C_BP_Group x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_BP_Group_Acct a "
|
||||
+ "WHERE a.C_BP_Group_ID=x.C_BP_Group_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_BP_Group_Acct ")
|
||||
.append("(C_BP_Group_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct,")
|
||||
.append(" V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct,")
|
||||
.append(" PayDiscount_Exp_Acct, PayDiscount_Rev_Acct, WriteOff_Acct,")
|
||||
.append(" NotInvoicedReceipts_Acct, UnEarnedRevenue_Acct) ")
|
||||
.append("SELECT x.C_BP_Group_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct,")
|
||||
.append(" acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct,")
|
||||
.append(" acct.PayDiscount_Exp_Acct, acct.PayDiscount_Rev_Acct, acct.WriteOff_Acct,")
|
||||
.append(" acct.NotInvoicedReceipts_Acct, acct.UnEarnedRevenue_Acct ")
|
||||
.append("FROM C_BP_Group x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_BP_Group_Acct a ")
|
||||
.append("WHERE a.C_BP_Group_ID=x.C_BP_Group_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_BP_Group_ID@");
|
||||
createdTotal += created;
|
||||
|
||||
|
||||
//IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
// Update Business Partner - Employee
|
||||
/*
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE C_BP_Employee_Acct a "
|
||||
+ "SET E_Expense_Acct=" + acct.getE_Expense_Acct()
|
||||
+ ", E_Prepayment_Acct=" + acct.getE_Prepayment_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM C_BP_Employee_Acct x "
|
||||
+ "WHERE x.C_BPartner_ID=a.C_BPartner_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE C_BP_Employee_Acct a ")
|
||||
.append("SET E_Expense_Acct=").append(acct.getE_Expense_Acct())
|
||||
.append(", E_Prepayment_Acct=").append(acct.getE_Prepayment_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM C_BP_Employee_Acct x ")
|
||||
.append("WHERE x.C_BPartner_ID=a.C_BPartner_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_BPartner_ID@ @IsEmployee@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new Business Partner - Employee
|
||||
sql = "INSERT INTO C_BP_Employee_Acct "
|
||||
+ "(C_BPartner_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " E_Expense_Acct, E_Prepayment_Acct) "
|
||||
+ "SELECT x.C_BPartner_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.E_Expense_Acct, acct.E_Prepayment_Acct "
|
||||
+ "FROM C_BPartner x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_BP_Employee_Acct a "
|
||||
+ "WHERE a.C_BPartner_ID=x.C_BPartner_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_BP_Employee_Acct ")
|
||||
.append("(C_BPartner_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" E_Expense_Acct, E_Prepayment_Acct) ")
|
||||
.append("SELECT x.C_BPartner_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.E_Expense_Acct, acct.E_Prepayment_Acct ")
|
||||
.append("FROM C_BPartner x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_BP_Employee_Acct a ")
|
||||
.append("WHERE a.C_BPartner_ID=x.C_BPartner_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsEmployee@");
|
||||
createdTotal += created;
|
||||
*/
|
||||
//
|
||||
if (!p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "INSERT INTO C_BP_Customer_Acct "
|
||||
+ "(C_BPartner_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct) "
|
||||
+ "SELECT p.C_BPartner_ID, acct.C_AcctSchema_ID,"
|
||||
+ " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct "
|
||||
+ "FROM C_BPartner p"
|
||||
+ " INNER JOIN C_BP_Group_Acct acct ON (acct.C_BP_Group_ID=p.C_BP_Group_ID)"
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID // #
|
||||
+ " AND p.C_BP_Group_ID=acct.C_BP_Group_ID"
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_BP_Customer_Acct ca "
|
||||
+ "WHERE ca.C_BPartner_ID=p.C_BPartner_ID"
|
||||
+ " AND ca.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_BP_Customer_Acct ")
|
||||
.append("(C_BPartner_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" C_Receivable_Acct, C_Receivable_Services_Acct, C_PrePayment_Acct) ")
|
||||
.append("SELECT p.C_BPartner_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.C_Receivable_Acct, acct.C_Receivable_Services_Acct, acct.C_PrePayment_Acct ")
|
||||
.append("FROM C_BPartner p")
|
||||
.append(" INNER JOIN C_BP_Group_Acct acct ON (acct.C_BP_Group_ID=p.C_BP_Group_ID)")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) // #
|
||||
.append(" AND p.C_BP_Group_ID=acct.C_BP_Group_ID")
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_BP_Customer_Acct ca ")
|
||||
.append("WHERE ca.C_BPartner_ID=p.C_BPartner_ID")
|
||||
.append(" AND ca.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsCustomer@");
|
||||
createdTotal += created;
|
||||
//
|
||||
sql = "INSERT INTO C_BP_Vendor_Acct "
|
||||
+ "(C_BPartner_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct) "
|
||||
+ "SELECT p.C_BPartner_ID, acct.C_AcctSchema_ID,"
|
||||
+ " p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct "
|
||||
+ "FROM C_BPartner p"
|
||||
+ " INNER JOIN C_BP_Group_Acct acct ON (acct.C_BP_Group_ID=p.C_BP_Group_ID)"
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID // #
|
||||
+ " AND p.C_BP_Group_ID=acct.C_BP_Group_ID"
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_BP_Vendor_Acct va "
|
||||
+ "WHERE va.C_BPartner_ID=p.C_BPartner_ID AND va.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_BP_Vendor_Acct ")
|
||||
.append("(C_BPartner_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" V_Liability_Acct, V_Liability_Services_Acct, V_PrePayment_Acct) ")
|
||||
.append("SELECT p.C_BPartner_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.V_Liability_Acct, acct.V_Liability_Services_Acct, acct.V_PrePayment_Acct ")
|
||||
.append("FROM C_BPartner p")
|
||||
.append(" INNER JOIN C_BP_Group_Acct acct ON (acct.C_BP_Group_ID=p.C_BP_Group_ID)")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID) // #
|
||||
.append(" AND p.C_BP_Group_ID=acct.C_BP_Group_ID")
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_BP_Vendor_Acct va ")
|
||||
.append("WHERE va.C_BPartner_ID=p.C_BPartner_ID AND va.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsVendor@");
|
||||
createdTotal += created;
|
||||
}
|
||||
|
||||
//IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
// Update Warehouse
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE M_Warehouse_Acct a "
|
||||
+ "SET W_Inventory_Acct=" + acct.getW_Inventory_Acct()
|
||||
+ ", W_Differences_Acct=" + acct.getW_Differences_Acct()
|
||||
+ ", W_Revaluation_Acct=" + acct.getW_Revaluation_Acct()
|
||||
+ ", W_InvActualAdjust_Acct=" + acct.getW_InvActualAdjust_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM M_Warehouse_Acct x "
|
||||
+ "WHERE x.M_Warehouse_ID=a.M_Warehouse_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE M_Warehouse_Acct a ")
|
||||
.append("SET W_Differences_Acct=").append(acct.getW_Differences_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM M_Warehouse_Acct x ")
|
||||
.append("WHERE x.M_Warehouse_ID=a.M_Warehouse_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @M_Warehouse_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new Warehouse
|
||||
sql = "INSERT INTO M_Warehouse_Acct "
|
||||
+ "(M_Warehouse_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " W_Inventory_Acct, W_Differences_Acct, W_Revaluation_Acct, W_InvActualAdjust_Acct) "
|
||||
+ "SELECT x.M_Warehouse_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.W_Inventory_Acct, acct.W_Differences_Acct, acct.W_Revaluation_Acct, acct.W_InvActualAdjust_Acct "
|
||||
+ "FROM M_Warehouse x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM M_Warehouse_Acct a "
|
||||
+ "WHERE a.M_Warehouse_ID=x.M_Warehouse_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO M_Warehouse_Acct ")
|
||||
.append("(M_Warehouse_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" W_Differences_Acct) ")
|
||||
.append("SELECT x.M_Warehouse_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.W_Differences_Acct ")
|
||||
.append("FROM M_Warehouse x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM M_Warehouse_Acct a ")
|
||||
.append("WHERE a.M_Warehouse_ID=x.M_Warehouse_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @M_Warehouse_ID@");
|
||||
createdTotal += created;
|
||||
|
||||
|
@ -332,68 +312,66 @@ public class AcctSchemaDefaultCopy extends SvrProcess
|
|||
// Update Project
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE C_Project_Acct a "
|
||||
+ "SET PJ_Asset_Acct=" + acct.getPJ_Asset_Acct()
|
||||
+ ", PJ_WIP_Acct=" + acct.getPJ_Asset_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM C_Project_Acct x "
|
||||
+ "WHERE x.C_Project_ID=a.C_Project_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE C_Project_Acct a ")
|
||||
.append("SET PJ_Asset_Acct=").append(acct.getPJ_Asset_Acct())
|
||||
.append(", PJ_WIP_Acct=").append(acct.getPJ_Asset_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM C_Project_Acct x ")
|
||||
.append("WHERE x.C_Project_ID=a.C_Project_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Project_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new Projects
|
||||
sql = "INSERT INTO C_Project_Acct "
|
||||
+ "(C_Project_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " PJ_Asset_Acct, PJ_WIP_Acct) "
|
||||
+ "SELECT x.C_Project_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.PJ_Asset_Acct, acct.PJ_WIP_Acct "
|
||||
+ "FROM C_Project x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_Project_Acct a "
|
||||
+ "WHERE a.C_Project_ID=x.C_Project_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_Project_Acct ")
|
||||
.append("(C_Project_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" PJ_Asset_Acct, PJ_WIP_Acct) ")
|
||||
.append("SELECT x.C_Project_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.PJ_Asset_Acct, acct.PJ_WIP_Acct ")
|
||||
.append("FROM C_Project x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_Project_Acct a ")
|
||||
.append("WHERE a.C_Project_ID=x.C_Project_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_Project_ID@");
|
||||
createdTotal += created;
|
||||
|
||||
|
||||
//IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
// Update Tax
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE C_Tax_Acct a "
|
||||
+ "SET T_Due_Acct=" + acct.getT_Due_Acct()
|
||||
+ ", T_Liability_Acct=" + acct.getT_Liability_Acct()
|
||||
+ ", T_Credit_Acct=" + acct.getT_Credit_Acct()
|
||||
+ ", T_Receivables_Acct=" + acct.getT_Receivables_Acct()
|
||||
+ ", T_Expense_Acct=" + acct.getT_Expense_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM C_Tax_Acct x "
|
||||
+ "WHERE x.C_Tax_ID=a.C_Tax_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE C_Tax_Acct a ")
|
||||
.append("SET T_Due_Acct=").append(acct.getT_Due_Acct())
|
||||
.append(", T_Credit_Acct=").append(acct.getT_Credit_Acct())
|
||||
.append(", T_Expense_Acct=").append(acct.getT_Expense_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM C_Tax_Acct x ")
|
||||
.append("WHERE x.C_Tax_ID=a.C_Tax_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Tax_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new Tax
|
||||
sql = "INSERT INTO C_Tax_Acct "
|
||||
+ "(C_Tax_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " T_Due_Acct, T_Liability_Acct, T_Credit_Acct, T_Receivables_Acct, T_Expense_Acct) "
|
||||
+ "SELECT x.C_Tax_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.T_Due_Acct, acct.T_Liability_Acct, acct.T_Credit_Acct, acct.T_Receivables_Acct, acct.T_Expense_Acct "
|
||||
+ "FROM C_Tax x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_Tax_Acct a "
|
||||
+ "WHERE a.C_Tax_ID=x.C_Tax_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_Tax_Acct ")
|
||||
.append("(C_Tax_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" T_Due_Acct, T_Credit_Acct, T_Expense_Acct) ")
|
||||
.append("SELECT x.C_Tax_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.T_Due_Acct, acct.T_Credit_Acct, acct.T_Expense_Acct ")
|
||||
.append("FROM C_Tax x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_Tax_Acct a ")
|
||||
.append("WHERE a.C_Tax_ID=x.C_Tax_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_Tax_ID@");
|
||||
createdTotal += created;
|
||||
|
||||
|
@ -401,112 +379,103 @@ public class AcctSchemaDefaultCopy extends SvrProcess
|
|||
// Update BankAccount
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE C_BankAccount_Acct a "
|
||||
+ "SET B_InTransit_Acct=" + acct.getB_InTransit_Acct()
|
||||
+ ", B_Asset_Acct=" + acct.getB_Asset_Acct()
|
||||
+ ", B_Expense_Acct=" + acct.getB_Expense_Acct()
|
||||
+ ", B_InterestRev_Acct=" + acct.getB_InterestRev_Acct()
|
||||
+ ", B_InterestExp_Acct=" + acct.getB_InterestExp_Acct()
|
||||
+ ", B_Unidentified_Acct=" + acct.getB_Unidentified_Acct()
|
||||
+ ", B_UnallocatedCash_Acct=" + acct.getB_UnallocatedCash_Acct()
|
||||
+ ", B_PaymentSelect_Acct=" + acct.getB_PaymentSelect_Acct()
|
||||
+ ", B_SettlementGain_Acct=" + acct.getB_SettlementGain_Acct()
|
||||
+ ", B_SettlementLoss_Acct=" + acct.getB_SettlementLoss_Acct()
|
||||
+ ", B_RevaluationGain_Acct=" + acct.getB_RevaluationGain_Acct()
|
||||
+ ", B_RevaluationLoss_Acct=" + acct.getB_RevaluationLoss_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM C_BankAccount_Acct x "
|
||||
+ "WHERE x.C_BankAccount_ID=a.C_BankAccount_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE C_BankAccount_Acct a ")
|
||||
.append("SET B_InTransit_Acct=").append(acct.getB_InTransit_Acct())
|
||||
.append(", B_Asset_Acct=").append(acct.getB_Asset_Acct())
|
||||
.append(", B_InterestRev_Acct=").append(acct.getB_InterestRev_Acct())
|
||||
.append(", B_InterestExp_Acct=").append(acct.getB_InterestExp_Acct())
|
||||
.append(", B_UnallocatedCash_Acct=").append(acct.getB_UnallocatedCash_Acct())
|
||||
.append(", B_PaymentSelect_Acct=").append(acct.getB_PaymentSelect_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM C_BankAccount_Acct x ")
|
||||
.append("WHERE x.C_BankAccount_ID=a.C_BankAccount_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_BankAccount_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new BankAccount
|
||||
sql = "INSERT INTO C_BankAccount_Acct "
|
||||
+ "(C_BankAccount_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " B_InTransit_Acct, B_Asset_Acct, B_Expense_Acct, B_InterestRev_Acct, B_InterestExp_Acct,"
|
||||
+ " B_Unidentified_Acct, B_UnallocatedCash_Acct, B_PaymentSelect_Acct,"
|
||||
+ " B_SettlementGain_Acct, B_SettlementLoss_Acct,"
|
||||
+ " B_RevaluationGain_Acct, B_RevaluationLoss_Acct) "
|
||||
+ "SELECT x.C_BankAccount_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.B_InTransit_Acct, acct.B_Asset_Acct, acct.B_Expense_Acct, acct.B_InterestRev_Acct, acct.B_InterestExp_Acct,"
|
||||
+ " acct.B_Unidentified_Acct, acct.B_UnallocatedCash_Acct, acct.B_PaymentSelect_Acct,"
|
||||
+ " acct.B_SettlementGain_Acct, acct.B_SettlementLoss_Acct,"
|
||||
+ " acct.B_RevaluationGain_Acct, acct.B_RevaluationLoss_Acct "
|
||||
+ "FROM C_BankAccount x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_BankAccount_Acct a "
|
||||
+ "WHERE a.C_BankAccount_ID=x.C_BankAccount_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_BankAccount_Acct ")
|
||||
.append("(C_BankAccount_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" B_InTransit_Acct, B_Asset_Acct, B_InterestRev_Acct, B_InterestExp_Acct,")
|
||||
.append(" B_UnallocatedCash_Acct, B_PaymentSelect_Acct) ")
|
||||
.append("SELECT x.C_BankAccount_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.B_InTransit_Acct, acct.B_Asset_Acct, acct.B_InterestRev_Acct, acct.B_InterestExp_Acct,")
|
||||
.append(" acct.B_UnallocatedCash_Acct, acct.B_PaymentSelect_Acct ")
|
||||
.append("FROM C_BankAccount x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_BankAccount_Acct a ")
|
||||
.append("WHERE a.C_BankAccount_ID=x.C_BankAccount_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_BankAccount_ID@");
|
||||
createdTotal += created;
|
||||
|
||||
|
||||
//IDEMPIERE-362 Hide things that don't work on iDempiere
|
||||
// Update Withholding
|
||||
/*
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE C_Withholding_Acct a "
|
||||
+ "SET Withholding_Acct=" + acct.getWithholding_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM C_Withholding_Acct x "
|
||||
+ "WHERE x.C_Withholding_ID=a.C_Withholding_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE C_Withholding_Acct a ")
|
||||
.append("SET Withholding_Acct=").append(acct.getWithholding_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM C_Withholding_Acct x ")
|
||||
.append("WHERE x.C_Withholding_ID=a.C_Withholding_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Withholding_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new Withholding
|
||||
sql = "INSERT INTO C_Withholding_Acct "
|
||||
+ "(C_Withholding_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " Withholding_Acct) "
|
||||
+ "SELECT x.C_Withholding_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.Withholding_Acct "
|
||||
+ "FROM C_Withholding x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_Withholding_Acct a "
|
||||
+ "WHERE a.C_Withholding_ID=x.C_Withholding_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_Withholding_Acct ")
|
||||
.append("(C_Withholding_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" Withholding_Acct) ")
|
||||
.append("SELECT x.C_Withholding_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.Withholding_Acct ")
|
||||
.append("FROM C_Withholding x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_Withholding_Acct a ")
|
||||
.append("WHERE a.C_Withholding_ID=x.C_Withholding_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_Withholding_ID@");
|
||||
createdTotal += created;
|
||||
|
||||
*/
|
||||
|
||||
// Update Charge
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE C_Charge_Acct a "
|
||||
+ "SET Ch_Expense_Acct=" + acct.getCh_Expense_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM C_Charge_Acct x "
|
||||
+ "WHERE x.C_Charge_ID=a.C_Charge_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE C_Charge_Acct a ")
|
||||
.append("SET Ch_Expense_Acct=").append(acct.getCh_Expense_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM C_Charge_Acct x ")
|
||||
.append("WHERE x.C_Charge_ID=a.C_Charge_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Charge_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new Charge
|
||||
sql = "INSERT INTO C_Charge_Acct "
|
||||
+ "(C_Charge_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " Ch_Expense_Acct) "
|
||||
+ "SELECT x.C_Charge_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.Ch_Expense_Acct "
|
||||
+ "FROM C_Charge x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_Charge_Acct a "
|
||||
+ "WHERE a.C_Charge_ID=x.C_Charge_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_Charge_Acct ")
|
||||
.append("(C_Charge_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" Ch_Expense_Acct) ")
|
||||
.append("SELECT x.C_Charge_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.Ch_Expense_Acct ")
|
||||
.append("FROM C_Charge x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_Charge_Acct a ")
|
||||
.append("WHERE a.C_Charge_ID=x.C_Charge_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_Charge_ID@");
|
||||
createdTotal += created;
|
||||
|
||||
|
@ -514,41 +483,42 @@ public class AcctSchemaDefaultCopy extends SvrProcess
|
|||
// Update Cashbook
|
||||
if (p_CopyOverwriteAcct)
|
||||
{
|
||||
sql = "UPDATE C_Cashbook_Acct a "
|
||||
+ "SET CB_Asset_Acct=" + acct.getCB_Asset_Acct()
|
||||
+ ", CB_Differences_Acct=" + acct.getCB_Differences_Acct()
|
||||
+ ", CB_CashTransfer_Acct=" + acct.getCB_CashTransfer_Acct()
|
||||
+ ", CB_Expense_Acct=" + acct.getCB_Expense_Acct()
|
||||
+ ", CB_Receipt_Acct=" + acct.getCB_Receipt_Acct()
|
||||
+ ", Updated=SysDate, UpdatedBy=0 "
|
||||
+ "WHERE a.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND EXISTS (SELECT * FROM C_Cashbook_Acct x "
|
||||
+ "WHERE x.C_Cashbook_ID=a.C_Cashbook_ID)";
|
||||
updated = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE C_Cashbook_Acct a ")
|
||||
.append("SET CB_Asset_Acct=").append(acct.getCB_Asset_Acct())
|
||||
.append(", CB_Differences_Acct=").append(acct.getCB_Differences_Acct())
|
||||
.append(", CB_CashTransfer_Acct=").append(acct.getCB_CashTransfer_Acct())
|
||||
.append(", CB_Expense_Acct=").append(acct.getCB_Expense_Acct())
|
||||
.append(", CB_Receipt_Acct=").append(acct.getCB_Receipt_Acct())
|
||||
.append(", Updated=SysDate, UpdatedBy=0 ")
|
||||
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM C_Cashbook_Acct x ")
|
||||
.append("WHERE x.C_Cashbook_ID=a.C_Cashbook_ID)");
|
||||
updated = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Cashbook_ID@");
|
||||
updatedTotal += updated;
|
||||
}
|
||||
// Insert new Cashbook
|
||||
sql = "INSERT INTO C_Cashbook_Acct "
|
||||
+ "(C_Cashbook_ID, C_AcctSchema_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " CB_Asset_Acct, CB_Differences_Acct, CB_CashTransfer_Acct,"
|
||||
+ " CB_Expense_Acct, CB_Receipt_Acct) "
|
||||
+ "SELECT x.C_Cashbook_ID, acct.C_AcctSchema_ID,"
|
||||
+ " x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,"
|
||||
+ " acct.CB_Asset_Acct, acct.CB_Differences_Acct, acct.CB_CashTransfer_Acct,"
|
||||
+ " acct.CB_Expense_Acct, acct.CB_Receipt_Acct "
|
||||
+ "FROM C_Cashbook x"
|
||||
+ " INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) "
|
||||
+ "WHERE acct.C_AcctSchema_ID=" + p_C_AcctSchema_ID
|
||||
+ " AND NOT EXISTS (SELECT * FROM C_Cashbook_Acct a "
|
||||
+ "WHERE a.C_Cashbook_ID=x.C_Cashbook_ID"
|
||||
+ " AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)";
|
||||
created = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("INSERT INTO C_Cashbook_Acct ")
|
||||
.append("(C_Cashbook_ID, C_AcctSchema_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
|
||||
.append(" CB_Asset_Acct, CB_Differences_Acct, CB_CashTransfer_Acct,")
|
||||
.append(" CB_Expense_Acct, CB_Receipt_Acct) ")
|
||||
.append("SELECT x.C_Cashbook_ID, acct.C_AcctSchema_ID,")
|
||||
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0,")
|
||||
.append(" acct.CB_Asset_Acct, acct.CB_Differences_Acct, acct.CB_CashTransfer_Acct,")
|
||||
.append(" acct.CB_Expense_Acct, acct.CB_Receipt_Acct ")
|
||||
.append("FROM C_Cashbook x")
|
||||
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
|
||||
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM C_Cashbook_Acct a ")
|
||||
.append("WHERE a.C_Cashbook_ID=x.C_Cashbook_ID")
|
||||
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
|
||||
created = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog(0, null, new BigDecimal(created), "@Created@ @C_Cashbook_ID@");
|
||||
createdTotal += created;
|
||||
|
||||
return "@Created@=" + createdTotal + ", @Updated@=" + updatedTotal;
|
||||
StringBuilder msgreturn = new StringBuilder("@Created@=").append(createdTotal).append(", @Updated@=").append(updatedTotal);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
} // AcctSchemaDefaultCopy
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.compiere.model.MPayment;
|
|||
import org.compiere.util.AdempiereSystemError;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
/**
|
||||
* Automatic Allocation Process
|
||||
|
@ -170,7 +171,8 @@ public class AllocationAuto extends SvrProcess
|
|||
}
|
||||
}
|
||||
//
|
||||
return "@Created@ #" + countBP + "/" + countAlloc;
|
||||
StringBuilder msgreturn = new StringBuilder("@Created@ #").append(countBP).append("/").append(countAlloc);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
@ -258,19 +260,19 @@ public class AllocationAuto extends SvrProcess
|
|||
private MPayment[] getPayments (int C_BPartner_ID)
|
||||
{
|
||||
ArrayList<MPayment> list = new ArrayList<MPayment>();
|
||||
String sql = "SELECT * FROM C_Payment "
|
||||
+ "WHERE IsAllocated='N' AND Processed='Y' AND C_BPartner_ID=?"
|
||||
+ " AND IsPrepayment='N' AND C_Charge_ID IS NULL ";
|
||||
StringBuilder sql = new StringBuilder("SELECT * FROM C_Payment ")
|
||||
.append("WHERE IsAllocated='N' AND Processed='Y' AND C_BPartner_ID=?")
|
||||
.append(" AND IsPrepayment='N' AND C_Charge_ID IS NULL ");
|
||||
if (ONLY_AP.equals(p_APAR))
|
||||
sql += "AND IsReceipt='N' ";
|
||||
sql.append("AND IsReceipt='N' ");
|
||||
else if (ONLY_AR.equals(p_APAR))
|
||||
sql += "AND IsReceipt='Y' ";
|
||||
sql += "ORDER BY DateTrx";
|
||||
sql.append("AND IsReceipt='Y' ");
|
||||
sql.append("ORDER BY DateTrx");
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
pstmt.setInt (1, C_BPartner_ID);
|
||||
rs = pstmt.executeQuery ();
|
||||
while (rs.next ())
|
||||
|
@ -288,7 +290,7 @@ public class AllocationAuto extends SvrProcess
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, sql, e);
|
||||
log.log(Level.SEVERE, sql.toString(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -308,18 +310,18 @@ public class AllocationAuto extends SvrProcess
|
|||
private MInvoice[] getInvoices (int C_BPartner_ID)
|
||||
{
|
||||
ArrayList<MInvoice> list = new ArrayList<MInvoice>();
|
||||
String sql = "SELECT * FROM C_Invoice "
|
||||
+ "WHERE IsPaid='N' AND Processed='Y' AND C_BPartner_ID=? ";
|
||||
StringBuilder sql = new StringBuilder("SELECT * FROM C_Invoice ")
|
||||
.append("WHERE IsPaid='N' AND Processed='Y' AND C_BPartner_ID=? ");
|
||||
if (ONLY_AP.equals(p_APAR))
|
||||
sql += "AND IsSOTrx='N' ";
|
||||
sql.append("AND IsSOTrx='N' ");
|
||||
else if (ONLY_AR.equals(p_APAR))
|
||||
sql += "AND IsSOTrx='Y' ";
|
||||
sql += "ORDER BY DateInvoiced";
|
||||
sql.append("AND IsSOTrx='Y' ");
|
||||
sql.append("ORDER BY DateInvoiced");
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
pstmt.setInt (1, C_BPartner_ID);
|
||||
rs = pstmt.executeQuery ();
|
||||
while (rs.next ())
|
||||
|
@ -336,7 +338,7 @@ public class AllocationAuto extends SvrProcess
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, sql, e);
|
||||
log.log(Level.SEVERE, sql.toString(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -396,7 +398,8 @@ public class AllocationAuto extends SvrProcess
|
|||
{
|
||||
if (payment.allocateIt())
|
||||
{
|
||||
addLog(0, payment.getDateAcct(), openAmt, payment.getDocumentNo() + " [1]",payment.get_Table_ID(),payment.getC_Payment_ID());
|
||||
String message = Msg.parseTranslation(getCtx(), "@PaymentAllocated@ " + payment.getDocumentNo() + " [1]");
|
||||
addLog(0, payment.getDateAcct(), openAmt, message, payment.get_Table_ID(), payment.getC_Payment_ID());
|
||||
count++;
|
||||
}
|
||||
break;
|
||||
|
@ -440,7 +443,8 @@ public class AllocationAuto extends SvrProcess
|
|||
{
|
||||
if (payment.allocateIt())
|
||||
{
|
||||
addLog(0, payment.getDateAcct(), availableAmt, payment.getDocumentNo() + " [n]");
|
||||
String message = Msg.parseTranslation(getCtx(), "@PaymentAllocated@ " + payment.getDocumentNo() + " [n]");
|
||||
addLog(0, payment.getDateAcct(), availableAmt, message);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@ -768,8 +772,9 @@ public class AllocationAuto extends SvrProcess
|
|||
|
||||
if (allocatedPayments.compareTo(allocatedInvoices) != 0)
|
||||
{
|
||||
throw new AdempiereSystemError("Allocated Payments=" + allocatedPayments
|
||||
+ " <> Invoices=" + allocatedInvoices);
|
||||
StringBuilder msg = new StringBuilder("Allocated Payments=").append(allocatedPayments)
|
||||
.append(" <> Invoices=").append(allocatedInvoices);
|
||||
throw new AdempiereSystemError(msg.toString());
|
||||
}
|
||||
processAllocation();
|
||||
return 1;
|
||||
|
@ -828,12 +833,15 @@ public class AllocationAuto extends SvrProcess
|
|||
if (m_allocation == null)
|
||||
return true;
|
||||
boolean success = m_allocation.processIt(MAllocationHdr.DOCACTION_Complete);
|
||||
if (!success)
|
||||
throw new IllegalStateException("Allocation Process Failed "+ m_allocation.getDocumentNo() +
|
||||
" " + m_allocation.getProcessMsg());
|
||||
if (!success){
|
||||
StringBuilder msg = new StringBuilder("Allocation Process Failed ").append(m_allocation.getDocumentNo())
|
||||
.append(" ").append( m_allocation.getProcessMsg());
|
||||
throw new IllegalStateException(msg.toString());
|
||||
}
|
||||
else
|
||||
m_allocation.saveEx();
|
||||
addLog(0, m_allocation.getDateAcct(), null, m_allocation.getDescription());
|
||||
String message = Msg.parseTranslation(getCtx(), "@AllocationProcessed@ " + m_allocation.getDescription());
|
||||
addLog(0, m_allocation.getDateAcct(), null, message);
|
||||
m_allocation = null;
|
||||
return success;
|
||||
} // processAllocation
|
||||
|
|
|
@ -115,14 +115,14 @@ public class AllocationReset extends SvrProcess
|
|||
}
|
||||
|
||||
// Selection
|
||||
StringBuffer sql = new StringBuffer("SELECT * FROM C_AllocationHdr ah "
|
||||
+ "WHERE EXISTS (SELECT * FROM C_AllocationLine al "
|
||||
+ "WHERE ah.C_AllocationHdr_ID=al.C_AllocationHdr_ID");
|
||||
StringBuilder sql = new StringBuilder("SELECT * FROM C_AllocationHdr ah ")
|
||||
.append("WHERE EXISTS (SELECT * FROM C_AllocationLine al ")
|
||||
.append("WHERE ah.C_AllocationHdr_ID=al.C_AllocationHdr_ID");
|
||||
if (p_C_BPartner_ID != 0)
|
||||
sql.append(" AND al.C_BPartner_ID=?");
|
||||
else if (p_C_BP_Group_ID != 0)
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_BPartner bp "
|
||||
+ "WHERE bp.C_BPartner_ID=al.C_BPartner_ID AND bp.C_BP_Group_ID=?)");
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_BPartner bp ")
|
||||
.append("WHERE bp.C_BPartner_ID=al.C_BPartner_ID AND bp.C_BP_Group_ID=?)");
|
||||
else
|
||||
sql.append(" AND AD_Client_ID=?");
|
||||
if (p_DateAcct_From != null)
|
||||
|
@ -132,9 +132,9 @@ public class AllocationReset extends SvrProcess
|
|||
// Do not delete Cash Trx
|
||||
sql.append(" AND al.C_CashLine_ID IS NULL)");
|
||||
// Open Period
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_Period p"
|
||||
+ " INNER JOIN C_PeriodControl pc ON (p.C_Period_ID=pc.C_Period_ID AND pc.DocBaseType='CMA') "
|
||||
+ "WHERE ah.DateAcct BETWEEN p.StartDate AND p.EndDate)");
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_Period p")
|
||||
.append(" INNER JOIN C_PeriodControl pc ON (p.C_Period_ID=pc.C_Period_ID AND pc.DocBaseType='CMA') ")
|
||||
.append("WHERE ah.DateAcct BETWEEN p.StartDate AND p.EndDate)");
|
||||
//
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
|
|
|
@ -112,10 +112,10 @@ public class AssetDelivery extends SvrProcess
|
|||
return msg;
|
||||
}
|
||||
//
|
||||
StringBuffer sql = new StringBuffer ("SELECT A_Asset_ID, GuaranteeDate "
|
||||
+ "FROM A_Asset a"
|
||||
+ " INNER JOIN M_Product p ON (a.M_Product_ID=p.M_Product_ID) "
|
||||
+ "WHERE ");
|
||||
StringBuilder sql = new StringBuilder("SELECT A_Asset_ID, GuaranteeDate ")
|
||||
.append("FROM A_Asset a")
|
||||
.append(" INNER JOIN M_Product p ON (a.M_Product_ID=p.M_Product_ID) ")
|
||||
.append("WHERE ");
|
||||
if (m_A_Asset_Group_ID != 0)
|
||||
sql.append("a.A_Asset_Group_ID=").append(m_A_Asset_Group_ID).append(" AND ");
|
||||
if (m_M_Product_ID != 0)
|
||||
|
|
|
@ -44,17 +44,17 @@ public class BOMFlagValidate extends SvrProcess {
|
|||
{
|
||||
|
||||
//Select Products where there's a BOM, and there are no lines
|
||||
String sql = "SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'Y' AND " +
|
||||
"M_Product_ID NOT IN (SELECT M_Product_ID FROM M_Product_BOM ) AND ";
|
||||
StringBuilder sql = new StringBuilder("SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'Y' AND ")
|
||||
.append("M_Product_ID NOT IN (SELECT M_Product_ID FROM M_Product_BOM ) AND ");
|
||||
if (p_M_Product_Category_ID == 0)
|
||||
sql += "AD_Client_ID= ?";
|
||||
sql.append("AD_Client_ID= ?");
|
||||
|
||||
else
|
||||
sql += "M_Product_Category_ID= ?";
|
||||
sql.append("M_Product_Category_ID= ?");
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
if (p_M_Product_Category_ID == 0)
|
||||
pstmt.setInt (1, Env.getAD_Client_ID(getCtx()));
|
||||
else
|
||||
|
@ -63,7 +63,8 @@ public class BOMFlagValidate extends SvrProcess {
|
|||
|
||||
while (rs.next())
|
||||
{
|
||||
addLog(0, null, null, rs.getString(1) + " BOM without BOM lines", MProduct.Table_ID, rs.getInt(2));
|
||||
StringBuilder msglog=new StringBuilder(rs.getString(1)).append(" BOM without BOM lines");
|
||||
addLog(0, null, null, msglog.toString(), MProduct.Table_ID, rs.getInt(2));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
|
@ -74,13 +75,13 @@ public class BOMFlagValidate extends SvrProcess {
|
|||
|
||||
PreparedStatement upstmt = null;
|
||||
try {
|
||||
String update = "UPDATE M_Product SET IsBOM = 'N' WHERE IsBOM = 'Y' AND M_Product_ID NOT IN " +
|
||||
"(SELECT M_Product_ID FROM M_Product_BOM ) AND ";
|
||||
StringBuilder update = new StringBuilder("UPDATE M_Product SET IsBOM = 'N' WHERE IsBOM = 'Y' AND M_Product_ID NOT IN ")
|
||||
.append("(SELECT M_Product_ID FROM M_Product_BOM ) AND ");
|
||||
if (p_M_Product_Category_ID == 0)
|
||||
update += "AD_Client_ID= ?";
|
||||
update.append("AD_Client_ID= ?");
|
||||
else
|
||||
update += "M_Product_Category_ID= ?";
|
||||
upstmt = DB.prepareStatement (update, get_TrxName());
|
||||
update.append("M_Product_Category_ID= ?");
|
||||
upstmt = DB.prepareStatement (update.toString(), get_TrxName());
|
||||
if (p_M_Product_Category_ID == 0)
|
||||
upstmt.setInt (1, Env.getAD_Client_ID(getCtx()));
|
||||
else
|
||||
|
@ -99,17 +100,17 @@ public class BOMFlagValidate extends SvrProcess {
|
|||
{
|
||||
|
||||
//Select Products where there's a BOM, and there are no lines
|
||||
String sql = "SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'N' AND " +
|
||||
"M_Product_ID IN (SELECT M_Product_ID FROM M_Product_BOM ) AND ";
|
||||
StringBuilder sql = new StringBuilder("SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'N' AND ")
|
||||
.append("M_Product_ID IN (SELECT M_Product_ID FROM M_Product_BOM ) AND ");
|
||||
if (p_M_Product_Category_ID == 0)
|
||||
sql += "AD_Client_ID= ?";
|
||||
sql.append("AD_Client_ID= ?");
|
||||
|
||||
else
|
||||
sql += "M_Product_Category_ID= ?";
|
||||
sql.append("M_Product_Category_ID= ?");
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
if (p_M_Product_Category_ID == 0)
|
||||
pstmt.setInt (1, Env.getAD_Client_ID(getCtx()));
|
||||
else
|
||||
|
@ -118,7 +119,8 @@ public class BOMFlagValidate extends SvrProcess {
|
|||
|
||||
while (rs.next())
|
||||
{
|
||||
addLog(0, null, null, rs.getString(1) + " not BOM with BOM lines", MProduct.Table_ID, rs.getInt(2));
|
||||
StringBuilder msglog = new StringBuilder(rs.getString(1)).append(" not BOM with BOM lines");
|
||||
addLog(0, null, null, msglog.toString(), MProduct.Table_ID, rs.getInt(2));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
|
@ -127,15 +129,15 @@ public class BOMFlagValidate extends SvrProcess {
|
|||
rs = null; pstmt = null;
|
||||
}
|
||||
|
||||
String update = "UPDATE M_Product SET ISBOM = 'Y' WHERE IsBOM = 'N' AND M_Product_ID IN " +
|
||||
"(SELECT M_Product_ID FROM M_Product_BOM ) AND ";
|
||||
StringBuilder update = new StringBuilder("UPDATE M_Product SET ISBOM = 'Y' WHERE IsBOM = 'N' AND M_Product_ID IN ")
|
||||
.append("(SELECT M_Product_ID FROM M_Product_BOM ) AND ");
|
||||
if (p_M_Product_Category_ID == 0)
|
||||
update += "AD_Client_ID= ?";
|
||||
update.append("AD_Client_ID= ?");
|
||||
else
|
||||
update += "M_Product_Category_ID= ?";
|
||||
update.append("M_Product_Category_ID= ?");
|
||||
PreparedStatement upstmt = null;
|
||||
try {
|
||||
upstmt = DB.prepareStatement (update, get_TrxName());
|
||||
upstmt = DB.prepareStatement (update.toString(), get_TrxName());
|
||||
if (p_M_Product_Category_ID == 0)
|
||||
upstmt.setInt (1, Env.getAD_Client_ID(getCtx()));
|
||||
else
|
||||
|
|
|
@ -101,10 +101,10 @@ public class BankStatementPayment extends SvrProcess
|
|||
ibs.setTrxAmt(payment.getPayAmt(true));
|
||||
ibs.saveEx();
|
||||
//
|
||||
String retString = "@C_Payment_ID@ = " + payment.getDocumentNo();
|
||||
StringBuilder retString = new StringBuilder("@C_Payment_ID@ = ").append(payment.getDocumentNo());
|
||||
if (payment.getOverUnderAmt().signum() != 0)
|
||||
retString += " - @OverUnderAmt@=" + payment.getOverUnderAmt();
|
||||
return retString;
|
||||
retString.append(" - @OverUnderAmt@=").append(payment.getOverUnderAmt());
|
||||
return retString.toString();
|
||||
} // createPayment - Import
|
||||
|
||||
/**
|
||||
|
@ -133,10 +133,10 @@ public class BankStatementPayment extends SvrProcess
|
|||
bsl.setPayment(payment);
|
||||
bsl.saveEx();
|
||||
//
|
||||
String retString = "@C_Payment_ID@ = " + payment.getDocumentNo();
|
||||
StringBuilder retString = new StringBuilder("@C_Payment_ID@ = ").append(payment.getDocumentNo());
|
||||
if (payment.getOverUnderAmt().signum() != 0)
|
||||
retString += " - @OverUnderAmt@=" + payment.getOverUnderAmt();
|
||||
return retString;
|
||||
retString.append(" - @OverUnderAmt@=").append(payment.getOverUnderAmt());
|
||||
return retString.toString();
|
||||
} // createPayment
|
||||
|
||||
|
||||
|
|
|
@ -146,8 +146,8 @@ public class ChangeLogProcess extends SvrProcess
|
|||
}
|
||||
// final call
|
||||
executeStatement();
|
||||
|
||||
return "@OK@: " + m_ok + " - @Errors@: " + m_errors + " - @Failed@: " + m_checkFailed;
|
||||
StringBuilder msgreturn = new StringBuilder("@OK@: ").append(m_ok).append(" - @Errors@: ").append(m_errors).append(" - @Failed@: ").append(m_checkFailed);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
|
||||
|
@ -369,7 +369,7 @@ public class ChangeLogProcess extends SvrProcess
|
|||
// Changed Tables
|
||||
+ " AND EXISTS (SELECT * FROM AD_ChangeLog l "
|
||||
+ "WHERE t.AD_Table_ID=l.AD_Table_ID)";
|
||||
StringBuffer update = null;
|
||||
StringBuilder update = null;
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
|
@ -384,14 +384,15 @@ public class ChangeLogProcess extends SvrProcess
|
|||
String columnName = tableName + "_ID";
|
||||
if (tableName.equals("AD_Ref_Table"))
|
||||
columnName = "AD_Reference_ID";
|
||||
update = new StringBuffer ("UPDATE AD_ChangeLog SET IsCustomization='Y' "
|
||||
+ "WHERE AD_Table_ID=").append(table.getAD_Table_ID());
|
||||
update = new StringBuilder ("UPDATE AD_ChangeLog SET IsCustomization='Y' ")
|
||||
.append("WHERE AD_Table_ID=").append(table.getAD_Table_ID());
|
||||
update.append (" AND Record_ID IN (SELECT ")
|
||||
.append (columnName)
|
||||
.append (" FROM ").append(tableName)
|
||||
.append (" WHERE EntityType IN ('D','C'))");
|
||||
int no = DB.executeUpdate(update.toString(), get_TrxName());
|
||||
log.config(table.getTableName() + " = " + no);
|
||||
StringBuilder msglog = new StringBuilder(table.getTableName()).append(" = ").append(no);
|
||||
log.config(msglog.toString());
|
||||
updateNo += no;
|
||||
|
||||
}
|
||||
|
|
|
@ -129,56 +129,72 @@ public class ColumnEncryption extends SvrProcess {
|
|||
}
|
||||
|
||||
// Start
|
||||
addLog(0, null, null, "Encryption Class = "
|
||||
+ SecureEngine.getClassName());
|
||||
StringBuilder msglog = new StringBuilder("Encryption Class = ")
|
||||
.append(SecureEngine.getClassName());
|
||||
addLog(0, null, null, msglog.toString());
|
||||
boolean error = false;
|
||||
|
||||
// Test Value
|
||||
if (p_TestValue != null && p_TestValue.length() > 0) {
|
||||
String encString = SecureEngine.encrypt(p_TestValue);
|
||||
addLog(0, null, null, "Encrypted Test Value=" + encString);
|
||||
msglog = new StringBuilder("Encrypted Test Value=").append(encString);
|
||||
addLog(0, null, null, msglog.toString());
|
||||
String clearString = SecureEngine.decrypt(encString);
|
||||
if (p_TestValue.equals(clearString))
|
||||
addLog(0, null, null, "Decrypted=" + clearString
|
||||
+ " (same as test value)");
|
||||
if (p_TestValue.equals(clearString)){
|
||||
msglog = new StringBuilder("Decrypted=").append(clearString)
|
||||
.append(" (same as test value)");
|
||||
addLog(0, null, null, msglog.toString());
|
||||
}
|
||||
else {
|
||||
addLog(0, null, null, "Decrypted=" + clearString
|
||||
+ " (NOT the same as test value - check algorithm)");
|
||||
msglog = new StringBuilder("Decrypted=").append(clearString)
|
||||
.append(" (NOT the same as test value - check algorithm)");
|
||||
addLog(0, null, null, msglog.toString());
|
||||
error = true;
|
||||
}
|
||||
int encLength = encString.length();
|
||||
addLog(0, null, null, "Test Length=" + p_TestValue.length()
|
||||
+ " -> " + encLength);
|
||||
if (encLength <= column.getFieldLength())
|
||||
addLog(0, null, null, "Encrypted Length (" + encLength
|
||||
+ ") fits into field (" + column.getFieldLength() + ")");
|
||||
msglog = new StringBuilder("Test Length=").append(p_TestValue.length())
|
||||
.append(" -> ").append(encLength);
|
||||
addLog(0, null, null, msglog.toString());
|
||||
if (encLength <= column.getFieldLength()){
|
||||
msglog = new StringBuilder("Encrypted Length (").append(encLength)
|
||||
.append(") fits into field (").append(column.getFieldLength()).append(")");
|
||||
addLog(0, null, null, msglog.toString());
|
||||
}
|
||||
else {
|
||||
addLog(0, null, null, "Encrypted Length (" + encLength
|
||||
+ ") does NOT fit into field ("
|
||||
+ column.getFieldLength() + ") - resize field");
|
||||
msglog = new StringBuilder("Encrypted Length (").append(encLength)
|
||||
.append(") does NOT fit into field (")
|
||||
.append(column.getFieldLength()).append(") - resize field");
|
||||
addLog(0, null, null, msglog.toString());
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Length Test
|
||||
if (p_MaxLength != 0) {
|
||||
String testClear = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
StringBuilder testClear = new StringBuilder();
|
||||
testClear.append("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
while (testClear.length() < p_MaxLength)
|
||||
testClear += testClear;
|
||||
testClear = testClear.substring(0, p_MaxLength);
|
||||
log.config("Test=" + testClear + " (" + p_MaxLength + ")");
|
||||
testClear.append(testClear);
|
||||
testClear.delete(p_MaxLength,testClear.length());
|
||||
msglog = new StringBuilder()
|
||||
.append("Test=").append(testClear.toString()).append(" (").append(p_MaxLength).append(")");
|
||||
log.config(msglog.toString());
|
||||
//
|
||||
String encString = SecureEngine.encrypt(testClear);
|
||||
String encString = SecureEngine.encrypt(testClear.toString());
|
||||
int encLength = encString.length();
|
||||
addLog(0, null, null, "Test Max Length=" + testClear.length()
|
||||
+ " -> " + encLength);
|
||||
if (encLength <= column.getFieldLength())
|
||||
addLog(0, null, null, "Encrypted Max Length (" + encLength
|
||||
+ ") fits into field (" + column.getFieldLength() + ")");
|
||||
msglog = new StringBuilder("Test Max Length=").append(testClear.length())
|
||||
.append(" -> ").append(encLength);
|
||||
addLog(0, null, null, msglog.toString());
|
||||
if (encLength <= column.getFieldLength()){
|
||||
msglog = new StringBuilder("Encrypted Max Length (").append(encLength)
|
||||
.append(") fits into field (").append(column.getFieldLength()).append(")");
|
||||
addLog(0, null, null, msglog.toString());
|
||||
}
|
||||
else {
|
||||
addLog(0, null, null, "Encrypted Max Length (" + encLength
|
||||
+ ") does NOT fit into field ("
|
||||
+ column.getFieldLength() + ") - resize field");
|
||||
msglog = new StringBuilder("Encrypted Max Length (").append(encLength)
|
||||
.append(") does NOT fit into field (")
|
||||
.append(column.getFieldLength()).append(") - resize field");
|
||||
addLog(0, null, null, msglog.toString());
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
@ -223,14 +239,18 @@ public class ColumnEncryption extends SvrProcess {
|
|||
}
|
||||
|
||||
if (p_IsEncrypted != column.isEncrypted()) {
|
||||
if (error || !p_ChangeSetting)
|
||||
addLog(0, null, null, "Encryption NOT changed - Encryption="
|
||||
+ column.isEncrypted());
|
||||
if (error || !p_ChangeSetting){
|
||||
msglog = new StringBuilder("Encryption NOT changed - Encryption=")
|
||||
.append(column.isEncrypted());
|
||||
addLog(0, null, null, msglog.toString());
|
||||
}
|
||||
else {
|
||||
column.setIsEncrypted(p_IsEncrypted);
|
||||
if (column.save())
|
||||
addLog(0, null, null, "Encryption CHANGED - Encryption="
|
||||
+ column.isEncrypted());
|
||||
if (column.save()){
|
||||
msglog = new StringBuilder("Encryption CHANGED - Encryption=")
|
||||
.append(column.isEncrypted());
|
||||
addLog(0, null, null, msglog.toString());
|
||||
}
|
||||
else
|
||||
addLog(0, null, null, "Save Error");
|
||||
}
|
||||
|
@ -270,17 +290,17 @@ public class ColumnEncryption extends SvrProcess {
|
|||
private int encryptColumnContents(String columnName, String tableName)
|
||||
throws Exception {
|
||||
int recordsEncrypted = 0;
|
||||
String idColumnName = tableName + "_ID";
|
||||
StringBuilder idColumnName = new StringBuilder(tableName).append("_ID");
|
||||
|
||||
StringBuffer selectSql = new StringBuffer();
|
||||
selectSql.append("SELECT " + idColumnName + "," + columnName);
|
||||
selectSql.append(" FROM " + tableName);
|
||||
selectSql.append(" ORDER BY " + idColumnName);
|
||||
StringBuilder selectSql = new StringBuilder();
|
||||
selectSql.append("SELECT ").append(idColumnName).append(",").append(columnName);
|
||||
selectSql.append(" FROM ").append(tableName);
|
||||
selectSql.append(" ORDER BY ").append(idColumnName);
|
||||
|
||||
StringBuffer updateSql = new StringBuffer();
|
||||
updateSql.append("UPDATE " + tableName);
|
||||
updateSql.append(" SET " + columnName + "=?");
|
||||
updateSql.append(" WHERE " + idColumnName + "=?");
|
||||
StringBuilder updateSql = new StringBuilder();
|
||||
updateSql.append("UPDATE ").append(tableName);
|
||||
updateSql.append(" SET ").append(columnName).append("=?");
|
||||
updateSql.append(" WHERE ").append(idColumnName).append("=?");
|
||||
|
||||
PreparedStatement selectStmt = null;
|
||||
PreparedStatement updateStmt = null;
|
||||
|
@ -321,13 +341,12 @@ public class ColumnEncryption extends SvrProcess {
|
|||
* @return The length of the encrypted column.
|
||||
*/
|
||||
private int encryptedColumnLength(int colLength) {
|
||||
String str = "";
|
||||
StringBuilder str = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < colLength; i++) {
|
||||
str += "1";
|
||||
}
|
||||
str = SecureEngine.encrypt(str);
|
||||
|
||||
str.append("1");
|
||||
}
|
||||
str = new StringBuilder(SecureEngine.encrypt(str.toString()));
|
||||
return str.length();
|
||||
} // encryptedColumnLength
|
||||
|
||||
|
@ -347,23 +366,23 @@ public class ColumnEncryption extends SvrProcess {
|
|||
int rowsEffected = -1;
|
||||
|
||||
// Select SQL
|
||||
StringBuffer selectSql = new StringBuffer();
|
||||
StringBuilder selectSql = new StringBuilder();
|
||||
selectSql.append("SELECT FieldLength");
|
||||
selectSql.append(" FROM AD_Column");
|
||||
selectSql.append(" WHERE AD_Column_ID=?");
|
||||
|
||||
// Alter SQL
|
||||
StringBuffer alterSql = new StringBuffer();
|
||||
alterSql.append("ALTER TABLE " + tableName);
|
||||
alterSql.append(" MODIFY " + columnName);
|
||||
alterSql.append("ALTER TABLE ").append(tableName);
|
||||
alterSql.append(" MODIFY ").append(columnName);
|
||||
alterSql.append(" NVARCHAR2(");
|
||||
alterSql.append(length + ") ");
|
||||
alterSql.append(length).append(") ");
|
||||
|
||||
// Update SQL
|
||||
StringBuffer updateSql = new StringBuffer();
|
||||
updateSql.append("UPDATE AD_Column");
|
||||
updateSql.append(" SET FieldLength=" + length);
|
||||
updateSql.append(" WHERE AD_Column_ID=" + columnID);
|
||||
updateSql.append(" SET FieldLength=").append(length);
|
||||
updateSql.append(" WHERE AD_Column_ID=").append(columnID);
|
||||
|
||||
PreparedStatement selectStmt = null;
|
||||
|
||||
|
|
|
@ -140,12 +140,12 @@ public class ColumnSync extends SvrProcess
|
|||
|
||||
if (no == -1)
|
||||
{
|
||||
String msg = "@Error@ ";
|
||||
StringBuilder msg = new StringBuilder("@Error@ ");
|
||||
ValueNamePair pp = CLogger.retrieveError();
|
||||
if (pp != null)
|
||||
msg = pp.getName() + " - ";
|
||||
msg += sql;
|
||||
throw new AdempiereUserError (msg);
|
||||
msg = new StringBuilder(pp.getName()).append(" - ");
|
||||
msg.append(sql);
|
||||
throw new AdempiereUserError (msg.toString());
|
||||
}
|
||||
return sql;
|
||||
} finally {
|
||||
|
|
|
@ -89,10 +89,10 @@ public class CommissionCalc extends SvrProcess
|
|||
comRun.setStartDate(p_StartDate);
|
||||
// 01-Jan-2000 - 31-Jan-2001 - USD
|
||||
SimpleDateFormat format = DisplayType.getDateFormat(DisplayType.Date);
|
||||
String description = format.format(p_StartDate)
|
||||
+ " - " + format.format(m_EndDate)
|
||||
+ " - " + MCurrency.getISO_Code(getCtx(), m_com.getC_Currency_ID());
|
||||
comRun.setDescription(description);
|
||||
StringBuilder description = new StringBuilder(format.format(p_StartDate))
|
||||
.append(" - ").append(format.format(m_EndDate))
|
||||
.append(" - ").append(MCurrency.getISO_Code(getCtx(), m_com.getC_Currency_ID()));
|
||||
comRun.setDescription(description.toString());
|
||||
if (!comRun.save())
|
||||
throw new AdempiereSystemError ("Could not save Commission Run");
|
||||
|
||||
|
@ -104,94 +104,94 @@ public class CommissionCalc extends SvrProcess
|
|||
if (!comAmt.save())
|
||||
throw new AdempiereSystemError ("Could not save Commission Amt");
|
||||
//
|
||||
StringBuffer sql = new StringBuffer();
|
||||
StringBuilder sql = new StringBuilder();
|
||||
if (MCommission.DOCBASISTYPE_Receipt.equals(m_com.getDocBasisType()))
|
||||
{
|
||||
if (m_com.isListDetails())
|
||||
{
|
||||
sql.append("SELECT h.C_Currency_ID, (l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt,"
|
||||
+ " (l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty,"
|
||||
+ " NULL, l.C_InvoiceLine_ID, p.DocumentNo||'_'||h.DocumentNo,"
|
||||
+ " COALESCE(prd.Value,l.Description), h.DateInvoiced "
|
||||
+ "FROM C_Payment p"
|
||||
+ " INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)"
|
||||
+ " INNER JOIN C_Invoice h ON (al.C_Invoice_ID = h.C_Invoice_ID)"
|
||||
+ " INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) "
|
||||
+ " LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) "
|
||||
+ "WHERE p.DocStatus IN ('CL','CO','RE')"
|
||||
+ " AND h.IsSOTrx='Y'"
|
||||
+ " AND p.AD_Client_ID = ?"
|
||||
+ " AND p.DateTrx BETWEEN ? AND ?");
|
||||
sql.append("SELECT h.C_Currency_ID, (l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt,")
|
||||
.append(" (l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty,")
|
||||
.append(" NULL, l.C_InvoiceLine_ID, p.DocumentNo||'_'||h.DocumentNo,")
|
||||
.append(" COALESCE(prd.Value,l.Description), h.DateInvoiced ")
|
||||
.append("FROM C_Payment p")
|
||||
.append(" INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)")
|
||||
.append(" INNER JOIN C_Invoice h ON (al.C_Invoice_ID = h.C_Invoice_ID)")
|
||||
.append(" INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) ")
|
||||
.append(" LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) ")
|
||||
.append("WHERE p.DocStatus IN ('CL','CO','RE')")
|
||||
.append(" AND h.IsSOTrx='Y'")
|
||||
.append(" AND p.AD_Client_ID = ?")
|
||||
.append(" AND p.DateTrx BETWEEN ? AND ?");
|
||||
}
|
||||
else
|
||||
{
|
||||
sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt,"
|
||||
+ " SUM(l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty,"
|
||||
+ " NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) "
|
||||
+ "FROM C_Payment p"
|
||||
+ " INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)"
|
||||
+ " INNER JOIN C_Invoice h ON (al.C_Invoice_ID = h.C_Invoice_ID)"
|
||||
+ " INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) "
|
||||
+ "WHERE p.DocStatus IN ('CL','CO','RE')"
|
||||
+ " AND h.IsSOTrx='Y'"
|
||||
+ " AND p.AD_Client_ID = ?"
|
||||
+ " AND p.DateTrx BETWEEN ? AND ?");
|
||||
sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt*al.Amount/h.GrandTotal) AS Amt,")
|
||||
.append(" SUM(l.QtyInvoiced*al.Amount/h.GrandTotal) AS Qty,")
|
||||
.append(" NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) ")
|
||||
.append("FROM C_Payment p")
|
||||
.append(" INNER JOIN C_AllocationLine al ON (p.C_Payment_ID=al.C_Payment_ID)")
|
||||
.append(" INNER JOIN C_Invoice h ON (al.C_Invoice_ID = h.C_Invoice_ID)")
|
||||
.append(" INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) ")
|
||||
.append("WHERE p.DocStatus IN ('CL','CO','RE')")
|
||||
.append(" AND h.IsSOTrx='Y'")
|
||||
.append(" AND p.AD_Client_ID = ?")
|
||||
.append(" AND p.DateTrx BETWEEN ? AND ?");
|
||||
}
|
||||
}
|
||||
else if (MCommission.DOCBASISTYPE_Order.equals(m_com.getDocBasisType()))
|
||||
{
|
||||
if (m_com.isListDetails())
|
||||
{
|
||||
sql.append("SELECT h.C_Currency_ID, l.LineNetAmt, l.QtyOrdered, "
|
||||
+ "l.C_OrderLine_ID, NULL, h.DocumentNo,"
|
||||
+ " COALESCE(prd.Value,l.Description),h.DateOrdered "
|
||||
+ "FROM C_Order h"
|
||||
+ " INNER JOIN C_OrderLine l ON (h.C_Order_ID = l.C_Order_ID)"
|
||||
+ " LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) "
|
||||
+ "WHERE h.DocStatus IN ('CL','CO')"
|
||||
+ " AND h.IsSOTrx='Y'"
|
||||
+ " AND h.AD_Client_ID = ?"
|
||||
+ " AND h.DateOrdered BETWEEN ? AND ?");
|
||||
sql.append("SELECT h.C_Currency_ID, l.LineNetAmt, l.QtyOrdered, ")
|
||||
.append("l.C_OrderLine_ID, NULL, h.DocumentNo,")
|
||||
.append(" COALESCE(prd.Value,l.Description),h.DateOrdered ")
|
||||
.append("FROM C_Order h")
|
||||
.append(" INNER JOIN C_OrderLine l ON (h.C_Order_ID = l.C_Order_ID)")
|
||||
.append(" LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) ")
|
||||
.append("WHERE h.DocStatus IN ('CL','CO')")
|
||||
.append(" AND h.IsSOTrx='Y'")
|
||||
.append(" AND h.AD_Client_ID = ?")
|
||||
.append(" AND h.DateOrdered BETWEEN ? AND ?");
|
||||
}
|
||||
else
|
||||
{
|
||||
sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt) AS Amt,"
|
||||
+ " SUM(l.QtyOrdered) AS Qty, "
|
||||
+ "NULL, NULL, NULL, NULL, MAX(h.DateOrdered) "
|
||||
+ "FROM C_Order h"
|
||||
+ " INNER JOIN C_OrderLine l ON (h.C_Order_ID = l.C_Order_ID) "
|
||||
+ "WHERE h.DocStatus IN ('CL','CO')"
|
||||
+ " AND h.IsSOTrx='Y'"
|
||||
+ " AND h.AD_Client_ID = ?"
|
||||
+ " AND h.DateOrdered BETWEEN ? AND ?");
|
||||
sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt) AS Amt,")
|
||||
.append(" SUM(l.QtyOrdered) AS Qty, ")
|
||||
.append("NULL, NULL, NULL, NULL, MAX(h.DateOrdered) ")
|
||||
.append("FROM C_Order h")
|
||||
.append(" INNER JOIN C_OrderLine l ON (h.C_Order_ID = l.C_Order_ID) ")
|
||||
.append("WHERE h.DocStatus IN ('CL','CO')")
|
||||
.append(" AND h.IsSOTrx='Y'")
|
||||
.append(" AND h.AD_Client_ID = ?")
|
||||
.append(" AND h.DateOrdered BETWEEN ? AND ?");
|
||||
}
|
||||
}
|
||||
else // Invoice Basis
|
||||
{
|
||||
if (m_com.isListDetails())
|
||||
{
|
||||
sql.append("SELECT h.C_Currency_ID, l.LineNetAmt, l.QtyInvoiced, "
|
||||
+ "NULL, l.C_InvoiceLine_ID, h.DocumentNo,"
|
||||
+ " COALESCE(prd.Value,l.Description),h.DateInvoiced "
|
||||
+ "FROM C_Invoice h"
|
||||
+ " INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID)"
|
||||
+ " LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) "
|
||||
+ "WHERE h.DocStatus IN ('CL','CO','RE')"
|
||||
+ " AND h.IsSOTrx='Y'"
|
||||
+ " AND h.AD_Client_ID = ?"
|
||||
+ " AND h.DateInvoiced BETWEEN ? AND ?");
|
||||
sql.append("SELECT h.C_Currency_ID, l.LineNetAmt, l.QtyInvoiced, ")
|
||||
.append("NULL, l.C_InvoiceLine_ID, h.DocumentNo,")
|
||||
.append(" COALESCE(prd.Value,l.Description),h.DateInvoiced ")
|
||||
.append("FROM C_Invoice h")
|
||||
.append(" INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID)")
|
||||
.append(" LEFT OUTER JOIN M_Product prd ON (l.M_Product_ID = prd.M_Product_ID) ")
|
||||
.append("WHERE h.DocStatus IN ('CL','CO','RE')")
|
||||
.append(" AND h.IsSOTrx='Y'")
|
||||
.append(" AND h.AD_Client_ID = ?")
|
||||
.append(" AND h.DateInvoiced BETWEEN ? AND ?");
|
||||
}
|
||||
else
|
||||
{
|
||||
sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt) AS Amt,"
|
||||
+ " SUM(l.QtyInvoiced) AS Qty, "
|
||||
+ "NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) "
|
||||
+ "FROM C_Invoice h"
|
||||
+ " INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) "
|
||||
+ "WHERE h.DocStatus IN ('CL','CO','RE')"
|
||||
+ " AND h.IsSOTrx='Y'"
|
||||
+ " AND h.AD_Client_ID = ?"
|
||||
+ " AND h.DateInvoiced BETWEEN ? AND ?");
|
||||
sql.append("SELECT h.C_Currency_ID, SUM(l.LineNetAmt) AS Amt,")
|
||||
.append(" SUM(l.QtyInvoiced) AS Qty, ")
|
||||
.append("NULL, NULL, NULL, NULL, MAX(h.DateInvoiced) ")
|
||||
.append("FROM C_Invoice h")
|
||||
.append(" INNER JOIN C_InvoiceLine l ON (h.C_Invoice_ID = l.C_Invoice_ID) ")
|
||||
.append("WHERE h.DocStatus IN ('CL','CO','RE')")
|
||||
.append(" AND h.IsSOTrx='Y'")
|
||||
.append(" AND h.AD_Client_ID = ?")
|
||||
.append(" AND h.DateInvoiced BETWEEN ? AND ?");
|
||||
}
|
||||
}
|
||||
// CommissionOrders/Invoices
|
||||
|
@ -221,19 +221,19 @@ public class CommissionCalc extends SvrProcess
|
|||
sql.append(" AND h.C_BPartner_ID=").append(lines[i].getC_BPartner_ID());
|
||||
// BPartner Group
|
||||
if (lines[i].getC_BP_Group_ID() != 0)
|
||||
sql.append(" AND h.C_BPartner_ID IN "
|
||||
+ "(SELECT C_BPartner_ID FROM C_BPartner WHERE C_BP_Group_ID=").append(lines[i].getC_BP_Group_ID()).append(")");
|
||||
sql.append(" AND h.C_BPartner_ID IN ")
|
||||
.append("(SELECT C_BPartner_ID FROM C_BPartner WHERE C_BP_Group_ID=").append(lines[i].getC_BP_Group_ID()).append(")");
|
||||
// Sales Region
|
||||
if (lines[i].getC_SalesRegion_ID() != 0)
|
||||
sql.append(" AND h.C_BPartner_Location_ID IN "
|
||||
+ "(SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_SalesRegion_ID=").append(lines[i].getC_SalesRegion_ID()).append(")");
|
||||
sql.append(" AND h.C_BPartner_Location_ID IN ")
|
||||
.append("(SELECT C_BPartner_Location_ID FROM C_BPartner_Location WHERE C_SalesRegion_ID=").append(lines[i].getC_SalesRegion_ID()).append(")");
|
||||
// Product
|
||||
if (lines[i].getM_Product_ID() != 0)
|
||||
sql.append(" AND l.M_Product_ID=").append(lines[i].getM_Product_ID());
|
||||
// Product Category
|
||||
if (lines[i].getM_Product_Category_ID() != 0)
|
||||
sql.append(" AND l.M_Product_ID IN "
|
||||
+ "(SELECT M_Product_ID FROM M_Product WHERE M_Product_Category_ID=").append(lines[i].getM_Product_Category_ID()).append(")");
|
||||
sql.append(" AND l.M_Product_ID IN ")
|
||||
.append("(SELECT M_Product_ID FROM M_Product WHERE M_Product_Category_ID=").append(lines[i].getM_Product_Category_ID()).append(")");
|
||||
// Payment Rule
|
||||
if (lines[i].getPaymentRule() != null)
|
||||
sql.append(" AND h.PaymentRule='").append(lines[i].getPaymentRule()).append("'");
|
||||
|
@ -254,9 +254,9 @@ public class CommissionCalc extends SvrProcess
|
|||
// Save Last Run
|
||||
m_com.setDateLastRun (p_StartDate);
|
||||
m_com.saveEx();
|
||||
|
||||
return "@C_CommissionRun_ID@ = " + comRun.getDocumentNo()
|
||||
+ " - " + comRun.getDescription();
|
||||
StringBuilder msgreturn = new StringBuilder("@C_CommissionRun_ID@ = ").append(comRun.getDocumentNo())
|
||||
.append(" - ").append(comRun.getDescription());
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
|
|
@ -112,7 +112,8 @@ public class CopyOrder extends SvrProcess
|
|||
//
|
||||
// Env.setSOTrx(getCtx(), newOrder.isSOTrx());
|
||||
// return "@C_Order_ID@ " + newOrder.getDocumentNo();
|
||||
return dt.getName() + ": " + newOrder.getDocumentNo();
|
||||
StringBuilder msgreturn = new StringBuilder(dt.getName()).append(": ").append(newOrder.getDocumentNo());
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
} // CopyOrder
|
|
@ -88,8 +88,8 @@ public class CopyRole extends SvrProcess
|
|||
String table = tables[i];
|
||||
String keycolumn = keycolumns[i];
|
||||
|
||||
String sql = "DELETE FROM " + table + " WHERE AD_Role_ID = " + m_AD_Role_ID_To;
|
||||
int no = DB.executeUpdateEx(sql, get_TrxName());
|
||||
StringBuilder sql = new StringBuilder("DELETE FROM ").append(table).append(" WHERE AD_Role_ID = ").append(m_AD_Role_ID_To);
|
||||
int no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
addLog(action++, null, BigDecimal.valueOf(no), "Old records deleted from " + table );
|
||||
|
||||
final boolean column_IsReadWrite =
|
||||
|
@ -97,29 +97,29 @@ public class CopyRole extends SvrProcess
|
|||
&& !table.equals(I_AD_Role_Included.Table_Name);
|
||||
final boolean column_SeqNo = table.equals(I_AD_Role_Included.Table_Name);
|
||||
|
||||
sql = "INSERT INTO " + table
|
||||
+ " (AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, "
|
||||
+ "AD_Role_ID, " + keycolumn +", isActive";
|
||||
sql = new StringBuilder("INSERT INTO ").append(table)
|
||||
.append(" (AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, ")
|
||||
.append( "AD_Role_ID, ").append(keycolumn).append(", isActive");
|
||||
if (column_SeqNo)
|
||||
sql += ", SeqNo ";
|
||||
sql.append(", SeqNo ");
|
||||
if (column_IsReadWrite)
|
||||
sql += ", isReadWrite) ";
|
||||
sql.append(", isReadWrite) ");
|
||||
else
|
||||
sql += ") ";
|
||||
sql += "SELECT " + m_AD_Client_ID
|
||||
+ ", "+ m_AD_Org_ID
|
||||
+ ", getdate(), "+ Env.getAD_User_ID(Env.getCtx())
|
||||
+ ", getdate(), "+ Env.getAD_User_ID(Env.getCtx())
|
||||
+ ", " + m_AD_Role_ID_To
|
||||
+ ", " + keycolumn
|
||||
+ ", IsActive ";
|
||||
sql.append(") ");
|
||||
sql.append("SELECT ").append(m_AD_Client_ID)
|
||||
.append(", ").append(m_AD_Org_ID)
|
||||
.append(", getdate(), ").append(Env.getAD_User_ID(Env.getCtx()))
|
||||
.append(", getdate(), ").append(Env.getAD_User_ID(Env.getCtx()))
|
||||
.append(", ").append(m_AD_Role_ID_To)
|
||||
.append(", ").append(keycolumn)
|
||||
.append(", IsActive ");
|
||||
if (column_SeqNo)
|
||||
sql += ", SeqNo ";
|
||||
sql.append(", SeqNo ");
|
||||
if (column_IsReadWrite)
|
||||
sql += ", isReadWrite ";
|
||||
sql += "FROM " + table + " WHERE AD_Role_ID = " + m_AD_Role_ID_From;
|
||||
sql.append(", isReadWrite ");
|
||||
sql.append("FROM ").append(table).append(" WHERE AD_Role_ID = ").append(m_AD_Role_ID_From);
|
||||
|
||||
no = DB.executeUpdateEx (sql, get_TrxName());
|
||||
no = DB.executeUpdateEx (sql.toString(), get_TrxName());
|
||||
|
||||
addLog(action++, null, new BigDecimal(no), "New records inserted into " + table );
|
||||
}
|
||||
|
|
|
@ -151,11 +151,13 @@ public class DistributionCreate extends SvrProcess
|
|||
// Update Qty
|
||||
if (m_singleOrder != null)
|
||||
{
|
||||
m_singleOrder.setDescription("# " + counter + " - " + m_totalQty);
|
||||
StringBuilder msg = new StringBuilder("# ").append(counter).append(" - ").append(m_totalQty);
|
||||
m_singleOrder.setDescription(msg.toString());
|
||||
m_singleOrder.saveEx();
|
||||
}
|
||||
|
||||
return "@Created@ #" + counter + " - @Qty@=" + m_totalQty;
|
||||
StringBuilder msgreturn = new StringBuilder("@Created@ #").append(counter).append(" - @Qty@=").append(m_totalQty);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
|
|
@ -320,10 +320,12 @@ public class DistributionRun extends SvrProcess
|
|||
for (int j = 0; j < m_runLines.length; j++)
|
||||
{
|
||||
MDistributionRunLine runLine = m_runLines[j];
|
||||
if (runLine.isActualMinGtTotal())
|
||||
throw new Exception ("Line " + runLine.getLine()
|
||||
+ " Sum of Min Qty=" + runLine.getActualMin()
|
||||
+ " is greater than Total Qty=" + runLine.getTotalQty());
|
||||
if (runLine.isActualMinGtTotal()){
|
||||
StringBuilder msg = new StringBuilder("Line ").append(runLine.getLine())
|
||||
.append(" Sum of Min Qty=").append(runLine.getActualMin())
|
||||
.append(" is greater than Total Qty=").append(runLine.getTotalQty());
|
||||
throw new Exception (msg.toString());
|
||||
}
|
||||
if (allocationEqTotal && !runLine.isActualAllocationEqTotal())
|
||||
allocationEqTotal = false;
|
||||
} // for all run lines
|
||||
|
@ -378,8 +380,9 @@ public class DistributionRun extends SvrProcess
|
|||
}
|
||||
}
|
||||
} // for all detail lines
|
||||
throw new Exception ("Cannot adjust Difference = " + difference
|
||||
+ " - You need to change Total Qty or Min Qty");
|
||||
StringBuilder msgexc = new StringBuilder("Cannot adjust Difference = ").append(difference)
|
||||
.append(" - You need to change Total Qty or Min Qty");
|
||||
throw new Exception (msgexc.toString());
|
||||
}
|
||||
else // Distibute
|
||||
{
|
||||
|
@ -394,9 +397,11 @@ public class DistributionRun extends SvrProcess
|
|||
ratioTotal = ratioTotal.add(detail.getRatio());
|
||||
}
|
||||
}
|
||||
if (ratioTotal.compareTo(Env.ZERO) == 0)
|
||||
throw new Exception ("Cannot distribute Difference = " + difference
|
||||
+ " - You need to change Total Qty or Min Qty");
|
||||
if (ratioTotal.compareTo(Env.ZERO) == 0){
|
||||
StringBuilder msgexc = new StringBuilder("Cannot distribute Difference = ").append(difference)
|
||||
.append(" - You need to change Total Qty or Min Qty");
|
||||
throw new Exception (msgexc.toString());
|
||||
}
|
||||
// Distribute
|
||||
for (int i = 0; i < m_details.length; i++)
|
||||
{
|
||||
|
@ -542,8 +547,8 @@ public class DistributionRun extends SvrProcess
|
|||
product = MProduct.get (getCtx(), detail.getM_Product_ID());
|
||||
if (p_IsTest)
|
||||
{
|
||||
addLog(0,null, detail.getActualAllocation(),
|
||||
bp.getName() + " - " + product.getName());
|
||||
StringBuilder msglog = new StringBuilder(bp.getName()).append(" - ").append(product.getName());
|
||||
addLog(0,null, detail.getActualAllocation(), msglog.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -566,8 +571,8 @@ public class DistributionRun extends SvrProcess
|
|||
log.log(Level.SEVERE, "OrderLine not saved");
|
||||
return false;
|
||||
}
|
||||
addLog(0,null, detail.getActualAllocation(), order.getDocumentNo()
|
||||
+ ": " + bp.getName() + " - " + product.getName());
|
||||
StringBuilder msglog = new StringBuilder(order.getDocumentNo()).append(": ").append(bp.getName()).append(" - ").append(product.getName());
|
||||
addLog(0,null, detail.getActualAllocation(), msglog.toString());
|
||||
}
|
||||
// finish order
|
||||
order = null;
|
||||
|
@ -584,40 +589,40 @@ public class DistributionRun extends SvrProcess
|
|||
private int insertDetailsDistributionDemand()
|
||||
{
|
||||
// Handle NULL
|
||||
String sql = "UPDATE M_DistributionRunLine SET MinQty = 0 WHERE MinQty IS NULL";
|
||||
int no = DB.executeUpdate(sql, get_TrxName());
|
||||
StringBuilder sql = new StringBuilder("UPDATE M_DistributionRunLine SET MinQty = 0 WHERE MinQty IS NULL");
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
|
||||
sql = "UPDATE M_DistributionListLine SET MinQty = 0 WHERE MinQty IS NULL";
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE M_DistributionListLine SET MinQty = 0 WHERE MinQty IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
|
||||
// Delete Old
|
||||
sql = "DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID="
|
||||
+ p_M_DistributionRun_ID;
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=")
|
||||
.append(p_M_DistributionRun_ID);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("insertDetails - deleted #" + no);
|
||||
|
||||
// Insert New
|
||||
sql = "INSERT INTO T_DistributionRunDetail "
|
||||
+ "(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,"
|
||||
+ "C_BPartner_ID, C_BPartner_Location_ID, M_Product_ID,"
|
||||
+ "Ratio, MinQty, Qty) "
|
||||
+"SELECT MAX(rl.M_DistributionRun_ID), MAX(rl.M_DistributionRunLine_ID),MAX(ll.M_DistributionList_ID), MAX(ll.M_DistributionListLine_ID), "
|
||||
+"MAX(rl.AD_Client_ID),MAX(rl.AD_Org_ID), MAX(rl.IsActive), MAX(rl.Created),MAX(rl.CreatedBy), MAX(rl.Updated),MAX(rl.UpdatedBy), "
|
||||
+"MAX(ll.C_BPartner_ID), MAX(ll.C_BPartner_Location_ID), MAX(rl.M_Product_ID),"
|
||||
sql = new StringBuilder("INSERT INTO T_DistributionRunDetail ")
|
||||
.append("(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID,")
|
||||
.append("AD_Client_ID,AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,")
|
||||
.append("C_BPartner_ID, C_BPartner_Location_ID, M_Product_ID,")
|
||||
.append("Ratio, MinQty, Qty) " )
|
||||
.append("SELECT MAX(rl.M_DistributionRun_ID), MAX(rl.M_DistributionRunLine_ID),MAX(ll.M_DistributionList_ID), MAX(ll.M_DistributionListLine_ID), ")
|
||||
.append("MAX(rl.AD_Client_ID),MAX(rl.AD_Org_ID), MAX(rl.IsActive), MAX(rl.Created),MAX(rl.CreatedBy), MAX(rl.Updated),MAX(rl.UpdatedBy), ")
|
||||
.append("MAX(ll.C_BPartner_ID), MAX(ll.C_BPartner_Location_ID), MAX(rl.M_Product_ID),")
|
||||
// Ration for this process is equal QtyToDeliver
|
||||
+"COALESCE (SUM(ol.QtyOrdered-ol.QtyDelivered-TargetQty), 0) , "
|
||||
.append("COALESCE (SUM(ol.QtyOrdered-ol.QtyDelivered-TargetQty), 0) , ")
|
||||
// Min Qty for this process is equal to TargetQty
|
||||
+" 0 , 0 FROM M_DistributionRunLine rl "
|
||||
+"INNER JOIN M_DistributionList l ON (rl.M_DistributionList_ID=l.M_DistributionList_ID) "
|
||||
+"INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) "
|
||||
+"INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID AND o.DocStatus IN ('DR','IN')) "
|
||||
+"INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) "
|
||||
+"INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID="+p_M_Warehouse_ID+") "
|
||||
+"WHERE rl.M_DistributionRun_ID="+p_M_DistributionRun_ID+" AND rl.IsActive='Y' AND ll.IsActive='Y' AND ol.DatePromised <= "+DB.TO_DATE(p_DatePromised)
|
||||
+" GROUP BY o.M_Shipper_ID , ll.C_BPartner_ID, ol.M_Product_ID";
|
||||
.append(" 0 , 0 FROM M_DistributionRunLine rl ")
|
||||
.append("INNER JOIN M_DistributionList l ON (rl.M_DistributionList_ID=l.M_DistributionList_ID) ")
|
||||
.append("INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) ")
|
||||
.append("INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID AND o.DocStatus IN ('DR','IN')) ")
|
||||
.append("INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) ")
|
||||
.append("INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID=").append(p_M_Warehouse_ID).append(") ")
|
||||
.append("WHERE rl.M_DistributionRun_ID=").append(p_M_DistributionRun_ID).append(" AND rl.IsActive='Y' AND ll.IsActive='Y' AND ol.DatePromised <= ").append(DB.TO_DATE(p_DatePromised))
|
||||
.append(" GROUP BY o.M_Shipper_ID , ll.C_BPartner_ID, ol.M_Product_ID");
|
||||
//+ " BETWEEN "+ DB.TO_DATE(p_DatePromised) +" AND "+ DB.TO_DATE(p_DatePromised_To)
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
|
||||
List<MDistributionRunDetail> records = new Query(getCtx(),
|
||||
MDistributionRunDetail.Table_Name,
|
||||
|
@ -647,16 +652,20 @@ public class DistributionRun extends SvrProcess
|
|||
|
||||
private BigDecimal getQtyDemand(int M_Product_ID)
|
||||
{
|
||||
StringBuffer sql = new StringBuffer("SELECT SUM (QtyOrdered-QtyDelivered-TargetQty) FROM DD_OrderLine ol INNER JOIN M_Locator l ON (l.M_Locator_ID=ol.M_Locator_ID) INNER JOIN DD_Order o ON (o.DD_Order_ID=ol.DD_Order_ID) ");
|
||||
//sql.append(" WHERE o.DocStatus IN ('DR','IN') AND ol.DatePromised BETWEEN ? AND ? AND l.M_Warehouse_ID=? AND ol.M_Product_ID=? GROUP BY M_Product_ID, l.M_Warehouse_ID");
|
||||
sql.append(" WHERE o.DocStatus IN ('DR','IN') AND ol.DatePromised <= ? AND l.M_Warehouse_ID=? AND ol.M_Product_ID=? GROUP BY M_Product_ID, l.M_Warehouse_ID");
|
||||
|
||||
|
||||
String sql = "SELECT SUM (QtyOrdered-QtyDelivered-TargetQty) " +
|
||||
"FROM DD_OrderLine ol " +
|
||||
"INNER JOIN M_Locator l ON (l.M_Locator_ID=ol.M_Locator_ID) " +
|
||||
"INNER JOIN DD_Order o ON (o.DD_Order_ID=ol.DD_Order_ID) " +
|
||||
" WHERE o.DocStatus IN ('DR','IN') " +
|
||||
"AND ol.DatePromised <= ? " +
|
||||
"AND l.M_Warehouse_ID=? " +
|
||||
"AND ol.M_Product_ID=? " +
|
||||
"GROUP BY M_Product_ID, l.M_Warehouse_ID";
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||
pstmt.setTimestamp(1, p_DatePromised);
|
||||
//pstmt.setTimestamp(2, p_DatePromised_To);
|
||||
pstmt.setInt(2, p_M_Warehouse_ID);
|
||||
|
@ -692,37 +701,37 @@ public class DistributionRun extends SvrProcess
|
|||
private int insertDetailsDistribution()
|
||||
{
|
||||
// Handle NULL
|
||||
String sql = "UPDATE M_DistributionRunLine SET MinQty = 0 WHERE MinQty IS NULL";
|
||||
int no = DB.executeUpdate(sql, get_TrxName());
|
||||
StringBuilder sql = new StringBuilder("UPDATE M_DistributionRunLine SET MinQty = 0 WHERE MinQty IS NULL");
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
|
||||
sql = "UPDATE M_DistributionListLine SET MinQty = 0 WHERE MinQty IS NULL";
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE M_DistributionListLine SET MinQty = 0 WHERE MinQty IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
|
||||
// Delete Old
|
||||
sql = "DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID="
|
||||
+ p_M_DistributionRun_ID;
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=")
|
||||
.append(p_M_DistributionRun_ID);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("insertDetails - deleted #" + no);
|
||||
|
||||
// Insert New
|
||||
sql = "INSERT INTO T_DistributionRunDetail "
|
||||
+ "(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,"
|
||||
+ "C_BPartner_ID, C_BPartner_Location_ID, M_Product_ID,"
|
||||
+ "Ratio, MinQty, Qty) "
|
||||
+"SELECT rl.M_DistributionRun_ID, rl.M_DistributionRunLine_ID,ll.M_DistributionList_ID, ll.M_DistributionListLine_ID, "
|
||||
+"rl.AD_Client_ID,rl.AD_Org_ID, rl.IsActive, rl.Created,rl.CreatedBy, rl.Updated,rl.UpdatedBy, "
|
||||
+"ll.C_BPartner_ID, ll.C_BPartner_Location_ID, rl.M_Product_ID, 0 , "
|
||||
+"ol.TargetQty AS MinQty , 0 FROM M_DistributionRunLine rl "
|
||||
+"INNER JOIN M_DistributionList l ON (rl.M_DistributionList_ID=l.M_DistributionList_ID) "
|
||||
+"INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) "
|
||||
+"INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID) "
|
||||
+"INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) AND ol.DatePromised"
|
||||
sql = new StringBuilder("INSERT INTO T_DistributionRunDetail ")
|
||||
.append("(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID,")
|
||||
.append("AD_Client_ID,AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,")
|
||||
.append("C_BPartner_ID, C_BPartner_Location_ID, M_Product_ID,")
|
||||
.append("Ratio, MinQty, Qty) ")
|
||||
.append("SELECT rl.M_DistributionRun_ID, rl.M_DistributionRunLine_ID,ll.M_DistributionList_ID, ll.M_DistributionListLine_ID, ")
|
||||
.append("rl.AD_Client_ID,rl.AD_Org_ID, rl.IsActive, rl.Created,rl.CreatedBy, rl.Updated,rl.UpdatedBy, ")
|
||||
.append("ll.C_BPartner_ID, ll.C_BPartner_Location_ID, rl.M_Product_ID, 0 , ")
|
||||
.append("ol.TargetQty AS MinQty , 0 FROM M_DistributionRunLine rl ")
|
||||
.append("INNER JOIN M_DistributionList l ON (rl.M_DistributionList_ID=l.M_DistributionList_ID) ")
|
||||
.append("INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) ")
|
||||
.append("INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID) ")
|
||||
.append("INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) AND ol.DatePromised")
|
||||
//+ " BETWEEN " + DB.TO_DATE(p_DatePromised) +" AND "+ DB.TO_DATE(p_DatePromised_To)
|
||||
+ "<="+DB.TO_DATE(p_DatePromised)
|
||||
+" INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID="+p_M_Warehouse_ID+") "
|
||||
+" WHERE rl.M_DistributionRun_ID="+p_M_DistributionRun_ID+" AND l.RatioTotal<>0 AND rl.IsActive='Y' AND ll.IsActive='Y'";
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
.append( "<=").append(DB.TO_DATE(p_DatePromised))
|
||||
.append(" INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID=").append(p_M_Warehouse_ID).append(") ")
|
||||
.append(" WHERE rl.M_DistributionRun_ID=").append(p_M_DistributionRun_ID).append(" AND l.RatioTotal<>0 AND rl.IsActive='Y' AND ll.IsActive='Y'");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
|
||||
Query query = MTable.get(getCtx(), I_T_DistributionRunDetail.Table_ID).
|
||||
createQuery(MDistributionRunDetail.COLUMNNAME_M_DistributionRun_ID + "=?", get_TrxName());
|
||||
|
@ -772,9 +781,9 @@ public class DistributionRun extends SvrProcess
|
|||
{
|
||||
MDistributionRunDetail detail = m_details[i];
|
||||
|
||||
StringBuffer sql = new StringBuffer("SELECT * FROM DD_OrderLine ol INNER JOIN DD_Order o ON (o.DD_Order_ID=ol.DD_Order_ID) INNER JOIN M_Locator l ON (l.M_Locator_ID=ol.M_Locator_ID) ");
|
||||
String sql = "SELECT * FROM DD_OrderLine ol INNER JOIN DD_Order o ON (o.DD_Order_ID=ol.DD_Order_ID) INNER JOIN M_Locator l ON (l.M_Locator_ID=ol.M_Locator_ID) ";
|
||||
//sql.append(" WHERE o.DocStatus IN ('DR','IN') AND o.C_BPartner_ID = ? AND M_Product_ID=? AND l.M_Warehouse_ID=? AND ol.DatePromised BETWEEN ? AND ? ");
|
||||
sql.append(" WHERE o.DocStatus IN ('DR','IN') AND o.C_BPartner_ID = ? AND M_Product_ID=? AND l.M_Warehouse_ID=? AND ol.DatePromised <=?");
|
||||
sql = sql + " WHERE o.DocStatus IN ('DR','IN') AND o.C_BPartner_ID = ? AND M_Product_ID=? AND l.M_Warehouse_ID=? AND ol.DatePromised <=?";
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
|
@ -930,12 +939,12 @@ public class DistributionRun extends SvrProcess
|
|||
if(p_ConsolidateDocument)
|
||||
{
|
||||
|
||||
String whereClause = "DocStatus IN ('DR','IN') AND AD_Org_ID=" + bp.getAD_OrgBP_ID_Int() + " AND " +
|
||||
MDDOrder.COLUMNNAME_C_BPartner_ID +"=? AND " +
|
||||
MDDOrder.COLUMNNAME_M_Warehouse_ID +"=? AND " +
|
||||
MDDOrder.COLUMNNAME_DatePromised +"<=? ";
|
||||
StringBuilder whereClause = new StringBuilder("DocStatus IN ('DR','IN') AND AD_Org_ID=").append(bp.getAD_OrgBP_ID_Int()).append(" AND ")
|
||||
.append(MDDOrder.COLUMNNAME_C_BPartner_ID).append("=? AND ")
|
||||
.append(MDDOrder.COLUMNNAME_M_Warehouse_ID).append("=? AND ")
|
||||
.append(MDDOrder.COLUMNNAME_DatePromised).append("<=? ");
|
||||
|
||||
order = new Query(getCtx(), MDDOrder.Table_Name, whereClause, get_TrxName())
|
||||
order = new Query(getCtx(), MDDOrder.Table_Name, whereClause.toString(), get_TrxName())
|
||||
.setParameters(new Object[]{lastC_BPartner_ID, ws[0].getM_Warehouse_ID(), p_DatePromised})
|
||||
.setOrderBy(MDDOrder.COLUMNNAME_DatePromised +" DESC")
|
||||
.first();
|
||||
|
@ -988,8 +997,8 @@ public class DistributionRun extends SvrProcess
|
|||
product = MProduct.get (getCtx(), detail.getM_Product_ID());
|
||||
if (p_IsTest)
|
||||
{
|
||||
addLog(0,null, detail.getActualAllocation(),
|
||||
bp.getName() + " - " + product.getName());
|
||||
StringBuilder msglog = new StringBuilder(bp.getName()).append(" - ").append(product.getName());
|
||||
addLog(0,null, detail.getActualAllocation(), msglog.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1017,7 +1026,9 @@ public class DistributionRun extends SvrProcess
|
|||
String Description ="";
|
||||
if (m_run.getName() != null)
|
||||
Description =Description.concat(m_run.getName());
|
||||
line.setDescription(Description + " " +Msg.translate(getCtx(), "Qty")+ " = " +QtyAllocation+" ");
|
||||
StringBuilder msgline = new StringBuilder(Description).append(" ").append(Msg.translate(getCtx(), "Qty"))
|
||||
.append(" = ").append(QtyAllocation).append(" ");
|
||||
line.setDescription(msgline.toString());
|
||||
//line.setConfirmedQty(QtyAllocation);
|
||||
line.saveEx();
|
||||
}
|
||||
|
@ -1032,7 +1043,8 @@ public class DistributionRun extends SvrProcess
|
|||
Description ="";
|
||||
if (m_run.getName() != null)
|
||||
Description =Description.concat(m_run.getName());
|
||||
line.setDescription(Description + " " +Msg.translate(getCtx(), "Qty")+ " = " +QtyAllocation+" ");
|
||||
StringBuilder msgline = new StringBuilder(Description).append(" ").append(Msg.translate(getCtx(), "Qty")).append(" = ").append(QtyAllocation).append(" ");
|
||||
line.setDescription(msgline.toString());
|
||||
line.setQty(line.getQtyEntered().add(QtyAllocation));
|
||||
//line.setConfirmedQty(line.getConfirmedQty().add( QtyAllocation));
|
||||
line.saveEx();
|
||||
|
@ -1064,12 +1076,15 @@ public class DistributionRun extends SvrProcess
|
|||
String Description ="";
|
||||
if (m_run.getName() != null)
|
||||
Description =Description.concat(m_run.getName());
|
||||
line.setDescription(Description + " " +Msg.translate(getCtx(), "Qty")+ " = " +detail.getActualAllocation()+" ");
|
||||
StringBuilder msgline = new StringBuilder(Description).append(" ").append(Msg.translate(getCtx(), "Qty")).append(" = ")
|
||||
.append(detail.getActualAllocation()).append(" ");
|
||||
line.setDescription(msgline.toString());
|
||||
line.saveEx();
|
||||
|
||||
}
|
||||
addLog(0,null, detail.getActualAllocation(), order.getDocumentNo()
|
||||
+ ": " + bp.getName() + " - " + product.getName());
|
||||
StringBuilder msglog = new StringBuilder(order.getDocumentNo())
|
||||
.append(": ").append(bp.getName()).append(" - ").append(product.getName());
|
||||
addLog(0,null, detail.getActualAllocation(), msglog.toString());
|
||||
}
|
||||
// finish order
|
||||
order = null;
|
||||
|
|
|
@ -132,7 +132,8 @@ public class DunningPrint extends SvrProcess
|
|||
MBPartner bp = new MBPartner (getCtx(), entry.getC_BPartner_ID(), get_TrxName());
|
||||
if (bp.get_ID() == 0)
|
||||
{
|
||||
addLog (entry.get_ID(), null, null, "@NotFound@: @C_BPartner_ID@ " + entry.getC_BPartner_ID());
|
||||
StringBuilder msglog = new StringBuilder("@NotFound@: @C_BPartner_ID@ ").append(entry.getC_BPartner_ID());
|
||||
addLog (entry.get_ID(), null, null,msglog.toString() );
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
|
@ -142,13 +143,15 @@ public class DunningPrint extends SvrProcess
|
|||
{
|
||||
if (to.get_ID() == 0)
|
||||
{
|
||||
addLog (entry.get_ID(), null, null, "@NotFound@: @AD_User_ID@ - " + bp.getName());
|
||||
StringBuilder msglog = new StringBuilder("@NotFound@: @AD_User_ID@ - ").append(bp.getName());
|
||||
addLog (entry.get_ID(), null, null,msglog.toString());
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
else if (to.getEMail() == null || to.getEMail().length() == 0)
|
||||
{
|
||||
addLog (entry.get_ID(), null, null, "@NotFound@: @EMail@ - " + to.getName());
|
||||
StringBuilder msglog = new StringBuilder("@NotFound@: @EMail@ - ").append(to.getName());
|
||||
addLog (entry.get_ID(), null, null, msglog.toString());
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
|
@ -163,8 +166,9 @@ public class DunningPrint extends SvrProcess
|
|||
bp.getName(),
|
||||
MDunningRunEntry.Table_ID,
|
||||
entry.getC_DunningRunEntry_ID(),
|
||||
entry.getC_BPartner_ID());
|
||||
info.setDescription(bp.getName() + ", Amt=" + entry.getAmt());
|
||||
entry.getC_BPartner_ID());
|
||||
StringBuilder msginfo = new StringBuilder(bp.getName()).append(", Amt=").append(entry.getAmt());
|
||||
info.setDescription(msginfo.toString());
|
||||
ReportEngine re = null;
|
||||
if (format != null)
|
||||
re = new ReportEngine(getCtx(), format, query, info);
|
||||
|
@ -174,8 +178,9 @@ public class DunningPrint extends SvrProcess
|
|||
EMail email = client.createEMail(to.getEMail(), null, null);
|
||||
if (!email.isValid())
|
||||
{
|
||||
addLog (entry.get_ID(), null, null,
|
||||
"@RequestActionEMailError@ Invalid EMail: " + to);
|
||||
StringBuilder msglog = new StringBuilder(
|
||||
"@RequestActionEMailError@ Invalid EMail: ").append(to);
|
||||
addLog (entry.get_ID(), null, null,msglog.toString() );
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
|
@ -193,7 +198,8 @@ public class DunningPrint extends SvrProcess
|
|||
//
|
||||
if (re != null) {
|
||||
File attachment = re.getPDF(File.createTempFile("Dunning", ".pdf"));
|
||||
log.fine(to + " - " + attachment);
|
||||
StringBuilder msglog = new StringBuilder(to.toString()).append(" - ").append(attachment);
|
||||
log.fine(msglog.toString());
|
||||
email.addAttachment(attachment);
|
||||
}
|
||||
//
|
||||
|
@ -202,15 +208,16 @@ public class DunningPrint extends SvrProcess
|
|||
um.saveEx();
|
||||
if (msg.equals(EMail.SENT_OK))
|
||||
{
|
||||
addLog (entry.get_ID(), null, null,
|
||||
bp.getName() + " @RequestActionEMailOK@");
|
||||
StringBuilder msglog = new StringBuilder(
|
||||
bp.getName()).append(" @RequestActionEMailOK@");
|
||||
addLog (entry.get_ID(), null, null,msglog.toString());
|
||||
count++;
|
||||
printed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
addLog (entry.get_ID(), null, null,
|
||||
bp.getName() + " @RequestActionEMailError@ " + msg);
|
||||
StringBuilder msglog = new StringBuilder(bp.getName()).append(" @RequestActionEMailError@ ").append(msg);
|
||||
addLog (entry.get_ID(), null, null,msglog.toString() );
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
|
@ -233,8 +240,10 @@ public class DunningPrint extends SvrProcess
|
|||
run.setProcessed(true);
|
||||
run.saveEx();
|
||||
}
|
||||
if (p_EMailPDF)
|
||||
return "@Sent@=" + count + " - @Errors@=" + errors;
|
||||
if (p_EMailPDF){
|
||||
StringBuilder msgreturn = new StringBuilder("@Sent@=").append(count).append(" - @Errors@=").append(errors);
|
||||
return msgreturn.toString();
|
||||
}
|
||||
return "@Printed@=" + count;
|
||||
} // doIt
|
||||
|
||||
|
|
|
@ -135,39 +135,41 @@ public class DunningRunCreate extends SvrProcess
|
|||
private int addInvoices(MDunningLevel level)
|
||||
{
|
||||
int count = 0;
|
||||
String sql = "SELECT i.C_Invoice_ID, i.C_Currency_ID,"
|
||||
+ " i.GrandTotal*i.MultiplierAP,"
|
||||
+ " invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID)*MultiplierAP,"
|
||||
+ " COALESCE(daysBetween(?,ips.DueDate),paymentTermDueDays(i.C_PaymentTerm_ID,i.DateInvoiced,?))," // ##1/2
|
||||
+ " i.IsInDispute, i.C_BPartner_ID, i.C_InvoicePaySchedule_ID "
|
||||
+ "FROM C_Invoice_v i "
|
||||
+ " LEFT OUTER JOIN C_InvoicePaySchedule ips ON (i.C_InvoicePaySchedule_ID=ips.C_InvoicePaySchedule_ID) "
|
||||
+ "WHERE i.IsPaid='N' AND i.AD_Client_ID=?" // ##3
|
||||
+ " AND i.DocStatus IN ('CO','CL')"
|
||||
+ " AND (i.DunningGrace IS NULL OR i.DunningGrace<?) "
|
||||
// Only BP(Group) with Dunning defined
|
||||
+ " AND EXISTS (SELECT * FROM C_DunningLevel dl "
|
||||
+ "WHERE dl.C_DunningLevel_ID=?" // // ##4
|
||||
+ " AND dl.C_Dunning_ID IN "
|
||||
+ "(SELECT COALESCE(bp.C_Dunning_ID, bpg.C_Dunning_ID) "
|
||||
+ "FROM C_BPartner bp"
|
||||
+ " INNER JOIN C_BP_Group bpg ON (bp.C_BP_Group_ID=bpg.C_BP_Group_ID) "
|
||||
+ "WHERE i.C_BPartner_ID=bp.C_BPartner_ID" +
|
||||
" AND (bp.DunningGrace IS NULL OR bp.DunningGrace<?)))";
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT i.C_Invoice_ID, i.C_Currency_ID,");
|
||||
sql.append(" i.GrandTotal*i.MultiplierAP,");
|
||||
sql.append(" invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID)*MultiplierAP,");
|
||||
sql.append(" COALESCE(daysBetween(?,ips.DueDate),paymentTermDueDays(i.C_PaymentTerm_ID,i.DateInvoiced,?)),");// ##1/2
|
||||
sql.append(" i.IsInDispute, i.C_BPartner_ID, i.C_InvoicePaySchedule_ID ");
|
||||
sql.append("FROM C_Invoice_v i ");
|
||||
sql.append(" LEFT OUTER JOIN C_InvoicePaySchedule ips ON (i.C_InvoicePaySchedule_ID=ips.C_InvoicePaySchedule_ID) ");
|
||||
sql.append("WHERE i.IsPaid='N' AND i.AD_Client_ID=?"); // ##3
|
||||
sql.append(" AND i.DocStatus IN ('CO','CL')");
|
||||
sql.append(" AND (i.DunningGrace IS NULL OR i.DunningGrace<?) ");
|
||||
// Only BP(Group) with Dunning defined
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_DunningLevel dl ");
|
||||
sql.append("WHERE dl.C_DunningLevel_ID=?"); //##4
|
||||
sql.append(" AND dl.C_Dunning_ID IN ");
|
||||
sql.append("(SELECT COALESCE(bp.C_Dunning_ID, bpg.C_Dunning_ID) ");
|
||||
sql.append("FROM C_BPartner bp");
|
||||
sql.append(" INNER JOIN C_BP_Group bpg ON (bp.C_BP_Group_ID=bpg.C_BP_Group_ID) ");
|
||||
sql.append("WHERE i.C_BPartner_ID=bp.C_BPartner_ID");
|
||||
sql.append(" AND (bp.DunningGrace IS NULL OR bp.DunningGrace<?)))");
|
||||
|
||||
if (p_C_BPartner_ID != 0)
|
||||
sql += " AND i.C_BPartner_ID=?"; // ##5
|
||||
sql.append(" AND i.C_BPartner_ID=?"); // ##5
|
||||
else if (p_C_BP_Group_ID != 0)
|
||||
sql += " AND EXISTS (SELECT * FROM C_BPartner bp "
|
||||
+ "WHERE i.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)"; // ##5
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_BPartner bp ")
|
||||
.append("WHERE i.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)");// ##5
|
||||
if (p_OnlySOTrx)
|
||||
sql += " AND i.IsSOTrx='Y'";
|
||||
sql.append(" AND i.IsSOTrx='Y'");
|
||||
if (!p_IsAllCurrencies)
|
||||
sql += " AND i.C_Currency_ID=" + p_C_Currency_ID;
|
||||
sql.append(" AND i.C_Currency_ID=").append(p_C_Currency_ID);
|
||||
if ( p_AD_Org_ID != 0 )
|
||||
sql += " AND i.AD_Org_ID=" + p_AD_Org_ID;
|
||||
sql.append(" AND i.AD_Org_ID=").append(p_AD_Org_ID);
|
||||
// log.info(sql);
|
||||
|
||||
String sql2=null;
|
||||
String sql2= "";
|
||||
|
||||
// if sequentially we must check for other levels with smaller days for
|
||||
// which this invoice is not yet included!
|
||||
|
@ -175,18 +177,20 @@ public class DunningRunCreate extends SvrProcess
|
|||
// Build a list of all topmost Dunning Levels
|
||||
MDunningLevel[] previousLevels = level.getPreviousLevels();
|
||||
if (previousLevels!=null && previousLevels.length>0) {
|
||||
String sqlAppend = "";
|
||||
StringBuilder sqlAppend = new StringBuilder();
|
||||
for (MDunningLevel element : previousLevels) {
|
||||
sqlAppend += " AND i.C_Invoice_ID IN (SELECT C_Invoice_ID FROM C_DunningRunLine WHERE " +
|
||||
"C_DunningRunEntry_ID IN (SELECT C_DunningRunEntry_ID FROM C_DunningRunEntry WHERE " +
|
||||
"C_DunningRun_ID IN (SELECT C_DunningRun_ID FROM C_DunningRunEntry WHERE " +
|
||||
"C_DunningLevel_ID=" + element.get_ID () + ")) AND Processed<>'N')";
|
||||
sqlAppend.append(" AND i.C_Invoice_ID IN (SELECT C_Invoice_ID FROM C_DunningRunLine WHERE ");
|
||||
sqlAppend.append("C_DunningRunEntry_ID IN (SELECT C_DunningRunEntry_ID FROM C_DunningRunEntry WHERE ");
|
||||
sqlAppend.append("C_DunningRun_ID IN (SELECT C_DunningRun_ID FROM C_DunningRunEntry WHERE ");
|
||||
sqlAppend.append("C_DunningLevel_ID=");
|
||||
sqlAppend.append(element.get_ID ());
|
||||
sqlAppend.append(")) AND Processed<>'N')");
|
||||
}
|
||||
sql += sqlAppend;
|
||||
sql.append(sqlAppend.toString());
|
||||
}
|
||||
}
|
||||
// ensure that we do only dunn what's not yet dunned, so we lookup the max of last Dunn Date which was processed
|
||||
sql2 = "SELECT COUNT(*), COALESCE(DAYSBETWEEN(MAX(dr2.DunningDate), MAX(dr.DunningDate)),0)"
|
||||
sql2 = "SELECT COUNT(*), COALESCE(DAYSBETWEEN(MAX(dr2.DunningDate), MAX(dr.DunningDate)),0)"
|
||||
+ "FROM C_DunningRun dr2, C_DunningRun dr"
|
||||
+ " INNER JOIN C_DunningRunEntry dre ON (dr.C_DunningRun_ID=dre.C_DunningRun_ID)"
|
||||
+ " INNER JOIN C_DunningRunLine drl ON (dre.C_DunningRunEntry_ID=drl.C_DunningRunEntry_ID) "
|
||||
|
@ -200,7 +204,7 @@ public class DunningRunCreate extends SvrProcess
|
|||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
pstmt.setTimestamp(1, m_run.getDunningDate());
|
||||
pstmt.setTimestamp(2, m_run.getDunningDate());
|
||||
pstmt.setInt (3, m_run.getAD_Client_ID());
|
||||
|
@ -212,7 +216,7 @@ public class DunningRunCreate extends SvrProcess
|
|||
else if (p_C_BP_Group_ID != 0)
|
||||
pstmt.setInt (7, p_C_BP_Group_ID);
|
||||
//
|
||||
pstmt2 = DB.prepareStatement (sql2, get_TrxName());
|
||||
pstmt2 = DB.prepareStatement (sql2.toString(), get_TrxName());
|
||||
//
|
||||
rs = pstmt.executeQuery ();
|
||||
while (rs.next ())
|
||||
|
@ -225,9 +229,15 @@ public class DunningRunCreate extends SvrProcess
|
|||
boolean IsInDispute = "Y".equals(rs.getString(6));
|
||||
int C_BPartner_ID = rs.getInt(7);
|
||||
int C_InvoicePaySchedule_ID = rs.getInt(8);
|
||||
log.fine("DaysAfterDue: " + DaysAfterDue.intValue() + " isShowAllDue: " + level.isShowAllDue());
|
||||
log.fine("C_Invoice_ID - DaysDue - GrandTotal: " + C_Invoice_ID + " - " + DaysDue + " - " + GrandTotal);
|
||||
log.fine("C_InvoicePaySchedule_ID: " + C_InvoicePaySchedule_ID);
|
||||
|
||||
StringBuilder msglog = new StringBuilder()
|
||||
.append("DaysAfterDue: ").append(DaysAfterDue.intValue()).append(" isShowAllDue: ").append(level.isShowAllDue());
|
||||
log.fine(msglog.toString());
|
||||
msglog = new StringBuilder()
|
||||
.append("C_Invoice_ID - DaysDue - GrandTotal: ").append(C_Invoice_ID).append(" - ").append(DaysDue).append(" - ").append(GrandTotal);
|
||||
log.fine(msglog.toString());
|
||||
msglog = new StringBuilder("C_InvoicePaySchedule_ID: ").append(C_InvoicePaySchedule_ID);
|
||||
log.fine(msglog.toString());
|
||||
//
|
||||
// Check for Dispute
|
||||
if (!p_IncludeInDispute && IsInDispute)
|
||||
|
@ -317,10 +327,12 @@ public class DunningRunCreate extends SvrProcess
|
|||
}
|
||||
catch (BPartnerNoAddressException e)
|
||||
{
|
||||
String msg = "@Skip@ @C_Invoice_ID@ " + MInvoice.get(getCtx(), C_Invoice_ID).getDocumentInfo()
|
||||
+ ", @C_BPartner_ID@ " + MBPartner.get(getCtx(), C_BPartner_ID).getName()
|
||||
+ " @No@ @IsActive@ @C_BPartner_Location_ID@";
|
||||
getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, msg);
|
||||
StringBuilder msg = new StringBuilder("@Skip@ @C_Invoice_ID@ ");
|
||||
msg.append(MInvoice.get(getCtx(), C_Invoice_ID).getDocumentInfo().toString());
|
||||
msg.append(", @C_BPartner_ID@ ");
|
||||
msg.append(MBPartner.get(getCtx(), C_BPartner_ID).getName().toString());
|
||||
msg.append(" @No@ @IsActive@ @C_BPartner_Location_ID@");
|
||||
getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, msg.toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -349,42 +361,44 @@ public class DunningRunCreate extends SvrProcess
|
|||
*/
|
||||
private int addPayments(MDunningLevel level)
|
||||
{
|
||||
String sql = "SELECT C_Payment_ID, C_Currency_ID, PayAmt,"
|
||||
+ " paymentAvailable(C_Payment_ID), C_BPartner_ID "
|
||||
+ "FROM C_Payment_v p "
|
||||
+ "WHERE AD_Client_ID=?" // ##1
|
||||
+ " AND IsAllocated='N' AND C_BPartner_ID IS NOT NULL"
|
||||
+ " AND C_Charge_ID IS NULL"
|
||||
+ " AND DocStatus IN ('CO','CL')"
|
||||
// Only BP(Group) with Dunning defined
|
||||
+ " AND EXISTS (SELECT * FROM C_DunningLevel dl "
|
||||
+ "WHERE dl.C_DunningLevel_ID=?" // // ##2
|
||||
+ " AND dl.C_Dunning_ID IN "
|
||||
+ "(SELECT COALESCE(bp.C_Dunning_ID, bpg.C_Dunning_ID) "
|
||||
+ "FROM C_BPartner bp"
|
||||
+ " INNER JOIN C_BP_Group bpg ON (bp.C_BP_Group_ID=bpg.C_BP_Group_ID) "
|
||||
+ "WHERE p.C_BPartner_ID=bp.C_BPartner_ID))";
|
||||
StringBuilder sql = new StringBuilder("SELECT C_Payment_ID, C_Currency_ID, PayAmt,");
|
||||
sql.append(" paymentAvailable(C_Payment_ID), C_BPartner_ID ");
|
||||
sql.append("FROM C_Payment_v p ");
|
||||
sql.append("WHERE AD_Client_ID=?"); // ##1
|
||||
sql.append(" AND IsAllocated='N' AND C_BPartner_ID IS NOT NULL");
|
||||
sql.append(" AND C_Charge_ID IS NULL");
|
||||
sql.append(" AND DocStatus IN ('CO','CL')");
|
||||
//Only BP(Group) with Dunning defined
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_DunningLevel dl ");
|
||||
sql.append("WHERE dl.C_DunningLevel_ID=?");
|
||||
sql.append(" AND dl.C_Dunning_ID IN ");
|
||||
sql.append("(SELECT COALESCE(bp.C_Dunning_ID, bpg.C_Dunning_ID) ");
|
||||
sql.append("FROM C_BPartner bp");
|
||||
sql.append(" INNER JOIN C_BP_Group bpg ON (bp.C_BP_Group_ID=bpg.C_BP_Group_ID) ");
|
||||
sql.append("WHERE p.C_BPartner_ID=bp.C_BPartner_ID))");
|
||||
|
||||
if (p_C_BPartner_ID != 0)
|
||||
sql += " AND C_BPartner_ID=?"; // ##3
|
||||
sql.append(" AND C_BPartner_ID=?"); // ##3
|
||||
else if (p_C_BP_Group_ID != 0)
|
||||
sql += " AND EXISTS (SELECT * FROM C_BPartner bp "
|
||||
+ "WHERE p.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)"; // ##3
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_BPartner bp ")
|
||||
.append("WHERE p.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)"); // ##3
|
||||
// If it is not a statement we will add lines only if InvoiceLines exists,
|
||||
// because we do not want to dunn for money we owe the customer!
|
||||
if (!level.isStatement())
|
||||
sql += " AND C_BPartner_ID IN (SELECT C_BPartner_ID FROM C_DunningRunEntry WHERE C_DunningRun_ID=" + m_run.get_ID () + ")";
|
||||
sql.append(" AND C_BPartner_ID IN (SELECT C_BPartner_ID FROM C_DunningRunEntry WHERE C_DunningRun_ID=")
|
||||
.append(m_run.get_ID ()).append(")");
|
||||
// show only receipts / if only Sales
|
||||
if (p_OnlySOTrx)
|
||||
sql += " AND IsReceipt='Y'";
|
||||
sql.append(" AND IsReceipt='Y'");
|
||||
if ( p_AD_Org_ID != 0 )
|
||||
sql += " AND p.AD_Org_ID=" + p_AD_Org_ID;
|
||||
sql.append(" AND p.AD_Org_ID=").append(p_AD_Org_ID);
|
||||
|
||||
int count = 0;
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
pstmt.setInt (1, getAD_Client_ID());
|
||||
pstmt.setInt (2, level.getC_DunningLevel_ID());
|
||||
if (p_C_BPartner_ID != 0)
|
||||
|
@ -413,7 +427,7 @@ public class DunningRunCreate extends SvrProcess
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, sql, e);
|
||||
log.log(Level.SEVERE, sql.toString(), e);
|
||||
getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, e.getLocalizedMessage());
|
||||
}
|
||||
finally
|
||||
|
@ -441,10 +455,13 @@ public class DunningRunCreate extends SvrProcess
|
|||
entry = m_run.getEntry (C_BPartner_ID, p_C_Currency_ID, p_SalesRep_ID, c_DunningLevel_ID);
|
||||
} catch (BPartnerNoAddressException e) {
|
||||
MPayment payment = new MPayment(getCtx(), C_Payment_ID, null);
|
||||
String msg = "@Skip@ @C_Payment_ID@ " + payment.getDocumentInfo()
|
||||
+ ", @C_BPartner_ID@ " + MBPartner.get(getCtx(), C_BPartner_ID).getName()
|
||||
+ " @No@ @IsActive@ @C_BPartner_Location_ID@";
|
||||
getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, msg);
|
||||
|
||||
StringBuilder msg = new StringBuilder("@Skip@ @C_Payment_ID@ ");
|
||||
msg.append(payment.getDocumentInfo().toString());
|
||||
msg.append(", @C_BPartner_ID@ ");
|
||||
msg.append(MBPartner.get(getCtx(), C_BPartner_ID).getName().toString());
|
||||
msg.append(" @No@ @IsActive@ @C_BPartner_Location_ID@");
|
||||
getProcessInfo().addLog(getProcessInfo().getAD_PInstance_ID(), null, null, msg.toString());
|
||||
return false;
|
||||
}
|
||||
if (entry.get_ID() == 0)
|
||||
|
|
|
@ -55,7 +55,8 @@ public class EMailTest extends SvrProcess
|
|||
|
||||
// Test Client Mail
|
||||
String clientTest = client.testEMail();
|
||||
addLog(0, null, null, client.getName() + ": " + clientTest);
|
||||
StringBuilder msglog = new StringBuilder(client.getName()).append(": ").append(clientTest);
|
||||
addLog(0, null, null, msglog.toString());
|
||||
|
||||
// Test Client DocumentDir
|
||||
if (!Ini.isClient())
|
||||
|
@ -75,7 +76,8 @@ public class EMailTest extends SvrProcess
|
|||
{
|
||||
MStore store = wstores[i];
|
||||
String test = store.testEMail();
|
||||
addLog(0, null, null, store.getName() + ": " + test);
|
||||
msglog = new StringBuilder(store.getName()).append(": ").append(test);
|
||||
addLog(0, null, null, msglog.toString());
|
||||
}
|
||||
|
||||
return clientTest;
|
||||
|
|
|
@ -76,21 +76,21 @@ public class ExpenseAPInvoice extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = new StringBuffer ("SELECT * "
|
||||
+ "FROM S_TimeExpense e "
|
||||
+ "WHERE e.Processed='Y'"
|
||||
+ " AND e.AD_Client_ID=?"); // #1
|
||||
StringBuilder sql = new StringBuilder ("SELECT * ")
|
||||
.append("FROM S_TimeExpense e ")
|
||||
.append("WHERE e.Processed='Y'")
|
||||
.append(" AND e.AD_Client_ID=?"); // #1
|
||||
if (m_C_BPartner_ID != 0)
|
||||
sql.append(" AND e.C_BPartner_ID=?"); // #2
|
||||
if (m_DateFrom != null)
|
||||
sql.append(" AND e.DateReport >= ?"); // #3
|
||||
if (m_DateTo != null)
|
||||
sql.append(" AND e.DateReport <= ?"); // #4
|
||||
sql.append(" AND EXISTS (SELECT * FROM S_TimeExpenseLine el "
|
||||
+ "WHERE e.S_TimeExpense_ID=el.S_TimeExpense_ID"
|
||||
+ " AND el.C_InvoiceLine_ID IS NULL"
|
||||
+ " AND el.ConvertedAmt<>0) "
|
||||
+ "ORDER BY e.C_BPartner_ID, e.S_TimeExpense_ID");
|
||||
sql.append(" AND EXISTS (SELECT * FROM S_TimeExpenseLine el ")
|
||||
.append("WHERE e.S_TimeExpense_ID=el.S_TimeExpense_ID")
|
||||
.append(" AND el.C_InvoiceLine_ID IS NULL")
|
||||
.append(" AND el.ConvertedAmt<>0) ")
|
||||
.append("ORDER BY e.C_BPartner_ID, e.S_TimeExpense_ID");
|
||||
//
|
||||
int old_BPartner_ID = -1;
|
||||
MInvoice invoice = null;
|
||||
|
@ -128,18 +128,19 @@ public class ExpenseAPInvoice extends SvrProcess
|
|||
invoice.setBPartner(bp);
|
||||
if (invoice.getC_BPartner_Location_ID() == 0)
|
||||
{
|
||||
log.log(Level.SEVERE, "No BP Location: " + bp);
|
||||
addLog(0, te.getDateReport(),
|
||||
null, "No Location: " + te.getDocumentNo() + " " + bp.getName());
|
||||
StringBuilder msglog = new StringBuilder("No BP Location: ").append(bp);
|
||||
log.log(Level.SEVERE, msglog.toString());
|
||||
msglog = new StringBuilder("No Location: ").append(te.getDocumentNo()).append(" ").append(bp.getName());
|
||||
addLog(0, te.getDateReport(), null, msglog.toString() );
|
||||
invoice = null;
|
||||
break;
|
||||
}
|
||||
invoice.setM_PriceList_ID(te.getM_PriceList_ID());
|
||||
invoice.setSalesRep_ID(te.getDoc_User_ID());
|
||||
String descr = Msg.translate(getCtx(), "S_TimeExpense_ID")
|
||||
+ ": " + te.getDocumentNo() + " "
|
||||
+ DisplayType.getDateFormat(DisplayType.Date).format(te.getDateReport());
|
||||
invoice.setDescription(descr);
|
||||
StringBuilder descr = new StringBuilder(Msg.translate(getCtx(), "S_TimeExpense_ID"))
|
||||
.append(": ").append(te.getDocumentNo()).append(" " )
|
||||
.append(DisplayType.getDateFormat(DisplayType.Date).format(te.getDateReport()));
|
||||
invoice.setDescription(descr.toString());
|
||||
if (!invoice.save())
|
||||
new IllegalStateException("Cannot save Invoice");
|
||||
old_BPartner_ID = bp.getC_BPartner_ID();
|
||||
|
@ -200,7 +201,8 @@ public class ExpenseAPInvoice extends SvrProcess
|
|||
rs = null; pstmt = null;
|
||||
}
|
||||
completeInvoice (invoice);
|
||||
return "@Created@=" + m_noInvoices;
|
||||
StringBuilder msgreturn = new StringBuilder("@Created@=").append(m_noInvoices);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
@ -213,8 +215,9 @@ public class ExpenseAPInvoice extends SvrProcess
|
|||
return;
|
||||
invoice.setDocAction(DocAction.ACTION_Prepare);
|
||||
if (!invoice.processIt(DocAction.ACTION_Prepare)) {
|
||||
log.warning("Invoice Process Failed: " + invoice + " - " + invoice.getProcessMsg());
|
||||
throw new IllegalStateException("Invoice Process Failed: " + invoice + " - " + invoice.getProcessMsg());
|
||||
StringBuilder msglog = new StringBuilder("Invoice Process Failed: ").append(invoice).append(" - ").append(invoice.getProcessMsg());
|
||||
log.warning(msglog.toString());
|
||||
throw new IllegalStateException(msglog.toString());
|
||||
|
||||
}
|
||||
if (!invoice.save())
|
||||
|
|
|
@ -84,18 +84,18 @@ public class ExpenseSOrder extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = new StringBuffer("SELECT * FROM S_TimeExpenseLine el "
|
||||
+ "WHERE el.AD_Client_ID=?" // #1
|
||||
+ " AND el.C_BPartner_ID>0 AND el.IsInvoiced='Y'" // Business Partner && to be invoiced
|
||||
+ " AND el.C_OrderLine_ID IS NULL" // not invoiced yet
|
||||
+ " AND EXISTS (SELECT * FROM S_TimeExpense e " // processed only
|
||||
+ "WHERE el.S_TimeExpense_ID=e.S_TimeExpense_ID AND e.Processed='Y')");
|
||||
StringBuilder sql = new StringBuilder("SELECT * FROM S_TimeExpenseLine el ")
|
||||
.append("WHERE el.AD_Client_ID=?") // #1
|
||||
.append(" AND el.C_BPartner_ID>0 AND el.IsInvoiced='Y'") // Business Partner && to be invoiced
|
||||
.append(" AND el.C_OrderLine_ID IS NULL") // not invoiced yet
|
||||
.append(" AND EXISTS (SELECT * FROM S_TimeExpense e ") // processed only
|
||||
.append("WHERE el.S_TimeExpense_ID=e.S_TimeExpense_ID AND e.Processed='Y')");
|
||||
if (p_C_BPartner_ID != 0)
|
||||
sql.append(" AND el.C_BPartner_ID=?"); // #2
|
||||
if (p_DateFrom != null || m_DateTo != null)
|
||||
{
|
||||
sql.append(" AND EXISTS (SELECT * FROM S_TimeExpense e "
|
||||
+ "WHERE el.S_TimeExpense_ID=e.S_TimeExpense_ID");
|
||||
sql.append(" AND EXISTS (SELECT * FROM S_TimeExpense e ")
|
||||
.append("WHERE el.S_TimeExpense_ID=e.S_TimeExpense_ID");
|
||||
if (p_DateFrom != null)
|
||||
sql.append(" AND e.DateReport >= ?"); // #3
|
||||
if (m_DateTo != null)
|
||||
|
@ -158,8 +158,8 @@ public class ExpenseSOrder extends SvrProcess
|
|||
rs = null; pstmt = null;
|
||||
}
|
||||
completeOrder ();
|
||||
|
||||
return "@Created@=" + m_noOrders;
|
||||
StringBuilder msgreturn = new StringBuilder("@Created@=").append(m_noOrders);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
@ -180,9 +180,11 @@ public class ExpenseSOrder extends SvrProcess
|
|||
m_order.setBPartner(bp);
|
||||
if (m_order.getC_BPartner_Location_ID() == 0)
|
||||
{
|
||||
log.log(Level.SEVERE, "No BP Location: " + bp);
|
||||
StringBuilder msglog = new StringBuilder("No BP Location: ").append(bp);
|
||||
log.log(Level.SEVERE, msglog.toString());
|
||||
msglog = new StringBuilder("No Location: ").append(te.getDocumentNo()).append(" ").append(bp.getName());
|
||||
addLog(0, te.getDateReport(),
|
||||
null, "No Location: " + te.getDocumentNo() + " " + bp.getName());
|
||||
null, msglog.toString());
|
||||
m_order = null;
|
||||
return;
|
||||
}
|
||||
|
@ -271,8 +273,10 @@ public class ExpenseSOrder extends SvrProcess
|
|||
return;
|
||||
m_order.setDocAction(DocAction.ACTION_Prepare);
|
||||
if (!m_order.processIt(DocAction.ACTION_Prepare)) {
|
||||
log.warning("Order Process Failed: " + m_order + " - " + m_order.getProcessMsg());
|
||||
throw new IllegalStateException("Order Process Failed: " + m_order + " - " + m_order.getProcessMsg());
|
||||
StringBuilder msglog = new StringBuilder("Order Process Failed: ").append(m_order).append(" - ").append(m_order.getProcessMsg());
|
||||
log.warning(msglog.toString());
|
||||
msglog = new StringBuilder("Order Process Failed: ").append(m_order).append(" - ").append(m_order.getProcessMsg());
|
||||
throw new IllegalStateException(msglog.toString());
|
||||
}
|
||||
if (!m_order.save())
|
||||
throw new IllegalStateException("Cannot save Order");
|
||||
|
|
|
@ -55,11 +55,11 @@ public class FactAcctSummary extends SvrProcess {
|
|||
@Override
|
||||
protected String doIt() throws Exception {
|
||||
|
||||
String where = "";
|
||||
StringBuilder where = new StringBuilder();
|
||||
if ( p_Cube_ID > 0)
|
||||
where = "PA_ReportCube_ID = " + p_Cube_ID;
|
||||
where = new StringBuilder("PA_ReportCube_ID = ").append(p_Cube_ID);
|
||||
|
||||
List<MReportCube> cubes = new Query(getCtx(), MReportCube.Table_Name, where, get_TrxName())
|
||||
List<MReportCube> cubes = new Query(getCtx(), MReportCube.Table_Name, where.toString(), get_TrxName())
|
||||
.setOnlyActiveRecords(true).setClient_ID()
|
||||
.list();
|
||||
|
||||
|
|
|
@ -88,35 +88,35 @@ public class ImportAccount extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID);
|
||||
|
||||
// **** Prepare ****
|
||||
|
||||
// Delete Old Imported
|
||||
if (m_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_ElementValue "
|
||||
+ "WHERE I_IsImported='Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_ElementValue ")
|
||||
.append("WHERE I_IsImported='Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID, 0),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " Processed = 'N', "
|
||||
+ " Processing = 'Y', "
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),")
|
||||
.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" Processed = 'N', ")
|
||||
.append(" Processing = 'Y', ")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Reset=" + no);
|
||||
|
||||
|
@ -125,53 +125,53 @@ public class ImportAccount extends SvrProcess
|
|||
// Set Element
|
||||
if (m_C_Element_ID != 0)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET ElementName=(SELECT Name FROM C_Element WHERE C_Element_ID=").append(m_C_Element_ID).append(") "
|
||||
+ "WHERE ElementName IS NULL AND C_Element_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET ElementName=(SELECT Name FROM C_Element WHERE C_Element_ID=").append(m_C_Element_ID).append(") ")
|
||||
.append("WHERE ElementName IS NULL AND C_Element_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Element Default=" + no);
|
||||
}
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue i "
|
||||
+ "SET C_Element_ID = (SELECT C_Element_ID FROM C_Element e"
|
||||
+ " WHERE i.ElementName=e.Name AND i.AD_Client_ID=e.AD_Client_ID)"
|
||||
+ "WHERE C_Element_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue i ")
|
||||
.append("SET C_Element_ID = (SELECT C_Element_ID FROM C_Element e")
|
||||
.append(" WHERE i.ElementName=e.Name AND i.AD_Client_ID=e.AD_Client_ID)")
|
||||
.append("WHERE C_Element_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Element=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Element, ' "
|
||||
+ "WHERE C_Element_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Element, ' ")
|
||||
.append("WHERE C_Element_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid Element=" + no);
|
||||
|
||||
// No Name, Value
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Name, ' "
|
||||
+ "WHERE (Value IS NULL OR Name IS NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Name, ' ")
|
||||
.append("WHERE (Value IS NULL OR Name IS NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid Name=" + no);
|
||||
|
||||
|
||||
// Set Column
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue i "
|
||||
+ "SET AD_Column_ID = (SELECT AD_Column_ID FROM AD_Column c"
|
||||
+ " WHERE UPPER(i.Default_Account)=UPPER(c.ColumnName)"
|
||||
+ " AND c.AD_Table_ID IN (315,266) AND AD_Reference_ID=25) "
|
||||
+ "WHERE Default_Account IS NOT NULL AND AD_Column_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue i ")
|
||||
.append("SET AD_Column_ID = (SELECT AD_Column_ID FROM AD_Column c")
|
||||
.append(" WHERE UPPER(i.Default_Account)=UPPER(c.ColumnName)")
|
||||
.append(" AND c.AD_Table_ID IN (315,266) AND AD_Reference_ID=25) ")
|
||||
.append("WHERE Default_Account IS NOT NULL AND AD_Column_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Column=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Column, ' "
|
||||
+ "WHERE AD_Column_ID IS NULL AND Default_Account IS NOT NULL"
|
||||
+ " AND UPPER(Default_Account)<>'DEFAULT_ACCT'" // ignore default account
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Column, ' ")
|
||||
.append("WHERE AD_Column_ID IS NULL AND Default_Account IS NOT NULL")
|
||||
.append(" AND UPPER(Default_Account)<>'DEFAULT_ACCT'") // ignore default account
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid Column=" + no);
|
||||
|
||||
|
@ -179,76 +179,77 @@ public class ImportAccount extends SvrProcess
|
|||
String[] yColumns = new String[] {"PostActual", "PostBudget", "PostStatistical", "PostEncumbrance"};
|
||||
for (int i = 0; i < yColumns.length; i++)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue SET ")
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue SET ")
|
||||
.append(yColumns[i]).append("='Y' WHERE ")
|
||||
.append(yColumns[i]).append(" IS NULL OR ")
|
||||
.append(yColumns[i]).append(" NOT IN ('Y','N')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
.append(yColumns[i]).append(" NOT IN ('Y','N')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set " + yColumns[i] + " Default=" + no);
|
||||
StringBuilder msglog = new StringBuilder("Set ").append(yColumns[i]).append(" Default=").append(no);
|
||||
log.fine(msglog.toString());
|
||||
}
|
||||
// Summary
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET IsSummary='N' "
|
||||
+ "WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET IsSummary='N' ")
|
||||
.append("WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set IsSummary Default=" + no);
|
||||
|
||||
// Doc Controlled
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET IsDocControlled = CASE WHEN AD_Column_ID IS NOT NULL THEN 'Y' ELSE 'N' END "
|
||||
+ "WHERE IsDocControlled IS NULL OR IsDocControlled NOT IN ('Y','N')"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET IsDocControlled = CASE WHEN AD_Column_ID IS NOT NULL THEN 'Y' ELSE 'N' END ")
|
||||
.append("WHERE IsDocControlled IS NULL OR IsDocControlled NOT IN ('Y','N')")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set IsDocumentControlled Default=" + no);
|
||||
|
||||
// Check Account Type A (E) L M O R
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET AccountType='E' "
|
||||
+ "WHERE AccountType IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET AccountType='E' ")
|
||||
.append("WHERE AccountType IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set AccountType Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountType, ' "
|
||||
+ "WHERE AccountType NOT IN ('A','E','L','M','O','R')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountType, ' ")
|
||||
.append("WHERE AccountType NOT IN ('A','E','L','M','O','R')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid AccountType=" + no);
|
||||
|
||||
// Check Account Sign (N) C B
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET AccountSign='N' "
|
||||
+ "WHERE AccountSign IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET AccountSign='N' ")
|
||||
.append("WHERE AccountSign IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set AccountSign Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountSign, ' "
|
||||
+ "WHERE AccountSign NOT IN ('N','C','D')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountSign, ' ")
|
||||
.append("WHERE AccountSign NOT IN ('N','C','D')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid AccountSign=" + no);
|
||||
|
||||
// No Value
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Key, ' "
|
||||
+ "WHERE (Value IS NULL OR Value='')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Key, ' ")
|
||||
.append("WHERE (Value IS NULL OR Value='')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid Key=" + no);
|
||||
|
||||
// **** Update ElementValue from existing
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue i "
|
||||
+ "SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM C_ElementValue ev"
|
||||
+ " INNER JOIN C_Element e ON (ev.C_Element_ID=e.C_Element_ID)"
|
||||
+ " WHERE i.C_Element_ID=e.C_Element_ID AND i.AD_Client_ID=e.AD_Client_ID"
|
||||
+ " AND i.Value=ev.Value) "
|
||||
+ "WHERE C_ElementValue_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue i ")
|
||||
.append("SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM C_ElementValue ev")
|
||||
.append(" INNER JOIN C_Element e ON (ev.C_Element_ID=e.C_Element_ID)")
|
||||
.append(" WHERE i.C_Element_ID=e.C_Element_ID AND i.AD_Client_ID=e.AD_Client_ID")
|
||||
.append(" AND i.Value=ev.Value) ")
|
||||
.append("WHERE C_ElementValue_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Found ElementValue=" + no);
|
||||
|
||||
|
@ -259,9 +260,9 @@ public class ImportAccount extends SvrProcess
|
|||
int noUpdate = 0;
|
||||
|
||||
// Go through Records
|
||||
sql = new StringBuffer ("SELECT * "
|
||||
+ "FROM I_ElementValue "
|
||||
+ "WHERE I_IsImported='N'").append(clientCheck)
|
||||
sql = new StringBuilder ("SELECT * ")
|
||||
.append("FROM I_ElementValue ")
|
||||
.append("WHERE I_IsImported='N'").append(clientCheck)
|
||||
.append(" ORDER BY I_ElementValue_ID");
|
||||
try
|
||||
{
|
||||
|
@ -286,8 +287,8 @@ public class ImportAccount extends SvrProcess
|
|||
}
|
||||
else
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert ElementValue "))
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert ElementValue "))
|
||||
.append("WHERE I_ElementValue_ID=").append(I_ElementValue_ID);
|
||||
DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
}
|
||||
|
@ -308,8 +309,8 @@ public class ImportAccount extends SvrProcess
|
|||
}
|
||||
else
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update ElementValue"))
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update ElementValue"))
|
||||
.append("WHERE I_ElementValue_ID=").append(I_ElementValue_ID);
|
||||
DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
}
|
||||
|
@ -324,9 +325,9 @@ public class ImportAccount extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
addLog (0, null, new BigDecimal (noInsert), "@C_ElementValue_ID@: @Inserted@");
|
||||
|
@ -335,29 +336,29 @@ public class ImportAccount extends SvrProcess
|
|||
commitEx();
|
||||
|
||||
// ***** Set Parent
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue i "
|
||||
+ "SET ParentElementValue_ID=(SELECT C_ElementValue_ID"
|
||||
+ " FROM C_ElementValue ev WHERE i.C_Element_ID=ev.C_Element_ID"
|
||||
+ " AND i.ParentValue=ev.Value AND i.AD_Client_ID=ev.AD_Client_ID) "
|
||||
+ "WHERE ParentElementValue_ID IS NULL"
|
||||
+ " AND I_IsImported='Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue i ")
|
||||
.append("SET ParentElementValue_ID=(SELECT C_ElementValue_ID")
|
||||
.append(" FROM C_ElementValue ev WHERE i.C_Element_ID=ev.C_Element_ID")
|
||||
.append(" AND i.ParentValue=ev.Value AND i.AD_Client_ID=ev.AD_Client_ID) ")
|
||||
.append("WHERE ParentElementValue_ID IS NULL")
|
||||
.append(" AND I_IsImported='Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Found Parent ElementValue=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET I_ErrorMsg=I_ErrorMsg||'Info=ParentNotFound, ' "
|
||||
+ "WHERE ParentElementValue_ID IS NULL AND ParentValue IS NOT NULL"
|
||||
+ " AND I_IsImported='Y' AND Processed='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET I_ErrorMsg=I_ErrorMsg||'Info=ParentNotFound, ' ")
|
||||
.append("WHERE ParentElementValue_ID IS NULL AND ParentValue IS NOT NULL")
|
||||
.append(" AND I_IsImported='Y' AND Processed='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Not Found Parent ElementValue=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("SELECT i.ParentElementValue_ID, i.I_ElementValue_ID,"
|
||||
+ " e.AD_Tree_ID, i.C_ElementValue_ID, i.Value||'-'||i.Name AS Info "
|
||||
+ "FROM I_ElementValue i"
|
||||
+ " INNER JOIN C_Element e ON (i.C_Element_ID=e.C_Element_ID) "
|
||||
+ "WHERE i.C_ElementValue_ID IS NOT NULL AND e.AD_Tree_ID IS NOT NULL"
|
||||
+ " AND i.ParentElementValue_ID IS NOT NULL"
|
||||
+ " AND i.I_IsImported='Y' AND Processed='N' AND i.AD_Client_ID=").append(m_AD_Client_ID);
|
||||
sql = new StringBuilder ("SELECT i.ParentElementValue_ID, i.I_ElementValue_ID,")
|
||||
.append(" e.AD_Tree_ID, i.C_ElementValue_ID, i.Value||'-'||i.Name AS Info ")
|
||||
.append("FROM I_ElementValue i")
|
||||
.append(" INNER JOIN C_Element e ON (i.C_Element_ID=e.C_Element_ID) ")
|
||||
.append("WHERE i.C_ElementValue_ID IS NOT NULL AND e.AD_Tree_ID IS NOT NULL")
|
||||
.append(" AND i.ParentElementValue_ID IS NOT NULL")
|
||||
.append(" AND i.I_IsImported='Y' AND Processed='N' AND i.AD_Client_ID=").append(m_AD_Client_ID);
|
||||
int noParentUpdate = 0;
|
||||
try
|
||||
{
|
||||
|
@ -402,10 +403,10 @@ public class ImportAccount extends SvrProcess
|
|||
commitEx();
|
||||
|
||||
// Reset Processing Flag
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET Processing='-'"
|
||||
+ "WHERE I_IsImported='Y' AND Processed='N' AND Processing='Y'"
|
||||
+ " AND C_ElementValue_ID IS NOT NULL")
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET Processing='-'")
|
||||
.append("WHERE I_IsImported='Y' AND Processed='N' AND Processing='Y'")
|
||||
.append(" AND C_ElementValue_ID IS NOT NULL")
|
||||
.append(clientCheck);
|
||||
if (m_updateDefaultAccounts)
|
||||
sql.append(" AND AD_Column_ID IS NULL");
|
||||
|
@ -413,17 +414,17 @@ public class ImportAccount extends SvrProcess
|
|||
log.fine("Reset Processing Flag=" + no);
|
||||
|
||||
if (m_updateDefaultAccounts)
|
||||
updateDefaults(clientCheck);
|
||||
updateDefaults(clientCheck.toString());
|
||||
|
||||
// Update Description
|
||||
sql = new StringBuffer("SELECT * FROM C_ValidCombination vc "
|
||||
+ "WHERE EXISTS (SELECT * FROM I_ElementValue i "
|
||||
+ "WHERE vc.Account_ID=i.C_ElementValue_ID)");
|
||||
sql = new StringBuilder("SELECT * FROM C_ValidCombination vc ")
|
||||
.append("WHERE EXISTS (SELECT * FROM I_ElementValue i ")
|
||||
.append("WHERE vc.Account_ID=i.C_ElementValue_ID)");
|
||||
|
||||
// Done
|
||||
sql = new StringBuffer ("UPDATE I_ElementValue "
|
||||
+ "SET Processing='N', Processed='Y'"
|
||||
+ "WHERE I_IsImported='Y'")
|
||||
sql = new StringBuilder ("UPDATE I_ElementValue ")
|
||||
.append("SET Processing='N', Processed='Y'")
|
||||
.append("WHERE I_IsImported='Y'")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Processed=" + no);
|
||||
|
@ -441,8 +442,8 @@ public class ImportAccount extends SvrProcess
|
|||
log.config("CreateNewCombination=" + m_createNewCombination);
|
||||
|
||||
// **** Update Defaults
|
||||
StringBuffer sql = new StringBuffer ("SELECT C_AcctSchema_ID FROM C_AcctSchema_Element "
|
||||
+ "WHERE C_Element_ID=?").append(clientCheck);
|
||||
StringBuilder sql = new StringBuilder ("SELECT C_AcctSchema_ID FROM C_AcctSchema_Element ")
|
||||
.append("WHERE C_Element_ID=?").append(clientCheck);
|
||||
try
|
||||
{
|
||||
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
|
@ -459,14 +460,14 @@ public class ImportAccount extends SvrProcess
|
|||
}
|
||||
|
||||
// Default Account DEFAULT_ACCT
|
||||
sql = new StringBuffer ("UPDATE C_AcctSchema_Element e "
|
||||
+ "SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM I_ElementValue i"
|
||||
+ " WHERE e.C_Element_ID=i.C_Element_ID AND i.C_ElementValue_ID IS NOT NULL"
|
||||
+ " AND UPPER(i.Default_Account)='DEFAULT_ACCT') "
|
||||
+ "WHERE EXISTS (SELECT * FROM I_ElementValue i"
|
||||
+ " WHERE e.C_Element_ID=i.C_Element_ID AND i.C_ElementValue_ID IS NOT NULL"
|
||||
+ " AND UPPER(i.Default_Account)='DEFAULT_ACCT' "
|
||||
+ " AND i.I_IsImported='Y' AND i.Processing='-')")
|
||||
sql = new StringBuilder ("UPDATE C_AcctSchema_Element e ")
|
||||
.append("SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM I_ElementValue i")
|
||||
.append(" WHERE e.C_Element_ID=i.C_Element_ID AND i.C_ElementValue_ID IS NOT NULL")
|
||||
.append(" AND UPPER(i.Default_Account)='DEFAULT_ACCT') ")
|
||||
.append("WHERE EXISTS (SELECT * FROM I_ElementValue i")
|
||||
.append(" WHERE e.C_Element_ID=i.C_Element_ID AND i.C_ElementValue_ID IS NOT NULL")
|
||||
.append(" AND UPPER(i.Default_Account)='DEFAULT_ACCT' ")
|
||||
.append(" AND i.I_IsImported='Y' AND i.Processing='-')")
|
||||
.append(clientCheck);
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@C_AcctSchema_Element_ID@: @Updated@");
|
||||
|
@ -484,21 +485,22 @@ public class ImportAccount extends SvrProcess
|
|||
MAcctSchema as = new MAcctSchema (getCtx(), C_AcctSchema_ID, get_TrxName());
|
||||
if (as.getAcctSchemaElement("AC").getC_Element_ID() != m_C_Element_ID)
|
||||
{
|
||||
log.log(Level.SEVERE, "C_Element_ID=" + m_C_Element_ID + " not in AcctSchema=" + as);
|
||||
StringBuilder msglog = new StringBuilder("C_Element_ID=").append(m_C_Element_ID).append(" not in AcctSchema=").append(as);
|
||||
log.log(Level.SEVERE, msglog.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
int[] counts = new int[] {0, 0, 0};
|
||||
|
||||
String sql = "SELECT i.C_ElementValue_ID, t.TableName, c.ColumnName, i.I_ElementValue_ID "
|
||||
+ "FROM I_ElementValue i"
|
||||
+ " INNER JOIN AD_Column c ON (i.AD_Column_ID=c.AD_Column_ID)"
|
||||
+ " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID) "
|
||||
+ "WHERE i.I_IsImported='Y' AND Processing='Y'"
|
||||
+ " AND i.C_ElementValue_ID IS NOT NULL AND C_Element_ID=?";
|
||||
StringBuilder sql = new StringBuilder("SELECT i.C_ElementValue_ID, t.TableName, c.ColumnName, i.I_ElementValue_ID ")
|
||||
.append("FROM I_ElementValue i")
|
||||
.append(" INNER JOIN AD_Column c ON (i.AD_Column_ID=c.AD_Column_ID)")
|
||||
.append(" INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID) ")
|
||||
.append("WHERE i.I_IsImported='Y' AND Processing='Y'")
|
||||
.append(" AND i.C_ElementValue_ID IS NOT NULL AND C_Element_ID=?");
|
||||
try
|
||||
{
|
||||
PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName());
|
||||
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
pstmt.setInt(1, m_C_Element_ID);
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
while (rs.next())
|
||||
|
@ -512,8 +514,8 @@ public class ImportAccount extends SvrProcess
|
|||
counts[u]++;
|
||||
if (u != UPDATE_ERROR)
|
||||
{
|
||||
sql = "UPDATE I_ElementValue SET Processing='N' "
|
||||
+ "WHERE I_ElementValue_ID=" + I_ElementValue_ID;
|
||||
sql = new StringBuilder("UPDATE I_ElementValue SET Processing='N' ")
|
||||
.append("WHERE I_ElementValue_ID=").append(I_ElementValue_ID);
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 1)
|
||||
log.log(Level.SEVERE, "Updated=" + no);
|
||||
|
@ -552,9 +554,10 @@ public class ImportAccount extends SvrProcess
|
|||
*/
|
||||
private int updateDefaultAccount (String TableName, String ColumnName, int C_AcctSchema_ID, int C_ElementValue_ID)
|
||||
{
|
||||
log.fine(TableName + "." + ColumnName + " - " + C_ElementValue_ID);
|
||||
StringBuilder msglog = new StringBuilder(TableName).append(".").append(ColumnName).append(" - ").append(C_ElementValue_ID);
|
||||
log.fine(msglog.toString());
|
||||
int retValue = UPDATE_ERROR;
|
||||
StringBuffer sql = new StringBuffer ("SELECT x.")
|
||||
StringBuilder sql = new StringBuilder ("SELECT x.")
|
||||
.append(ColumnName).append(",Account_ID FROM ")
|
||||
.append(TableName).append(" x INNER JOIN C_ValidCombination vc ON (x.")
|
||||
.append(ColumnName).append("=vc.C_ValidCombination_ID) ")
|
||||
|
@ -586,13 +589,14 @@ public class ImportAccount extends SvrProcess
|
|||
int newC_ValidCombination_ID = acct.getC_ValidCombination_ID();
|
||||
if (C_ValidCombination_ID != newC_ValidCombination_ID)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE ").append(TableName)
|
||||
sql = new StringBuilder ("UPDATE ").append(TableName)
|
||||
.append(" SET ").append(ColumnName).append("=").append(newC_ValidCombination_ID)
|
||||
.append(" WHERE C_AcctSchema_ID=").append(C_AcctSchema_ID);
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("New #" + no + " - "
|
||||
+ TableName + "." + ColumnName + " - " + C_ElementValue_ID
|
||||
+ " -- " + C_ValidCombination_ID + " -> " + newC_ValidCombination_ID);
|
||||
msglog = new StringBuilder("New #").append(no).append(" - ")
|
||||
.append(TableName).append(".").append(ColumnName).append(" - ").append(C_ElementValue_ID)
|
||||
.append(" -- ").append(C_ValidCombination_ID).append(" -> ").append(newC_ValidCombination_ID);
|
||||
log.fine(msglog.toString());
|
||||
if (no == 1)
|
||||
retValue = UPDATE_YES;
|
||||
}
|
||||
|
@ -603,25 +607,28 @@ public class ImportAccount extends SvrProcess
|
|||
else // Replace Combination
|
||||
{
|
||||
// Only Acct Combination directly
|
||||
sql = new StringBuffer ("UPDATE C_ValidCombination SET Account_ID=")
|
||||
sql = new StringBuilder ("UPDATE C_ValidCombination SET Account_ID=")
|
||||
.append(C_ElementValue_ID).append(" WHERE C_ValidCombination_ID=").append(C_ValidCombination_ID);
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Replace #" + no + " - "
|
||||
+ "C_ValidCombination_ID=" + C_ValidCombination_ID + ", New Account_ID=" + C_ElementValue_ID);
|
||||
msglog = new StringBuilder("Replace #").append(no).append(" - ")
|
||||
.append("C_ValidCombination_ID=").append(C_ValidCombination_ID).append(", New Account_ID=").append(C_ElementValue_ID);
|
||||
log.fine(msglog.toString());
|
||||
if (no == 1)
|
||||
{
|
||||
retValue = UPDATE_YES;
|
||||
// Where Acct was used
|
||||
sql = new StringBuffer ("UPDATE C_ValidCombination SET Account_ID=")
|
||||
sql = new StringBuilder ("UPDATE C_ValidCombination SET Account_ID=")
|
||||
.append(C_ElementValue_ID).append(" WHERE Account_ID=").append(Account_ID);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("ImportAccount.updateDefaultAccount - Replace VC #" + no + " - "
|
||||
+ "Account_ID=" + Account_ID + ", New Account_ID=" + C_ElementValue_ID);
|
||||
sql = new StringBuffer ("UPDATE Fact_Acct SET Account_ID=")
|
||||
msglog = new StringBuilder("ImportAccount.updateDefaultAccount - Replace VC #").append(no).append(" - ")
|
||||
.append("Account_ID=").append(Account_ID).append(", New Account_ID=").append(C_ElementValue_ID);
|
||||
log.fine(msglog.toString());
|
||||
sql = new StringBuilder ("UPDATE Fact_Acct SET Account_ID=")
|
||||
.append(C_ElementValue_ID).append(" WHERE Account_ID=").append(Account_ID);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("ImportAccount.updateDefaultAccount - Replace Fact #" + no + " - "
|
||||
+ "Account_ID=" + Account_ID + ", New Account_ID=" + C_ElementValue_ID);
|
||||
msglog = new StringBuilder("ImportAccount.updateDefaultAccount - Replace Fact #").append(no).append(" - ")
|
||||
.append("Account_ID=").append(Account_ID).append(", New Account_ID=").append(C_ElementValue_ID);
|
||||
log.fine(msglog.toString());
|
||||
}
|
||||
} // replace combination
|
||||
} // need to update
|
||||
|
|
|
@ -91,7 +91,7 @@ implements ImportProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = getWhereClause();
|
||||
|
||||
|
@ -100,50 +100,50 @@ implements ImportProcess
|
|||
// Delete Old Imported
|
||||
if (m_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_BPartner "
|
||||
+ "WHERE I_IsImported='Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_BPartner ")
|
||||
.append("WHERE I_IsImported='Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_BPartner "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID, 0),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder ("UPDATE I_BPartner ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),")
|
||||
.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Reset=" + no);
|
||||
|
||||
ModelValidationEngine.get().fireImportValidate(this, null, null, ImportValidator.TIMING_BEFORE_VALIDATE);
|
||||
|
||||
// Set BP_Group
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET GroupValue=(SELECT MAX(Value) FROM C_BP_Group g WHERE g.IsDefault='Y'"
|
||||
+ " AND g.AD_Client_ID=i.AD_Client_ID) ");
|
||||
sql.append("WHERE GroupValue IS NULL AND C_BP_Group_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET GroupValue=(SELECT MAX(Value) FROM C_BP_Group g WHERE g.IsDefault='Y'")
|
||||
.append(" AND g.AD_Client_ID=i.AD_Client_ID) ");
|
||||
sql.append("WHERE GroupValue IS NULL AND C_BP_Group_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Set Group Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET C_BP_Group_ID=(SELECT C_BP_Group_ID FROM C_BP_Group g"
|
||||
+ " WHERE i.GroupValue=g.Value AND g.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE C_BP_Group_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET C_BP_Group_ID=(SELECT C_BP_Group_ID FROM C_BP_Group g")
|
||||
.append(" WHERE i.GroupValue=g.Value AND g.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE C_BP_Group_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Set Group=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_BPartner "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Group, ' "
|
||||
+ "WHERE C_BP_Group_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Group, ' ")
|
||||
.append("WHERE C_BP_Group_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.config("Invalid Group=" + no);
|
||||
|
||||
|
@ -158,123 +158,123 @@ implements ImportProcess
|
|||
log.fine("Set Country Default=" + no);
|
||||
**/
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c"
|
||||
+ " WHERE i.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, i.AD_Client_ID)) "
|
||||
+ "WHERE C_Country_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c")
|
||||
.append(" WHERE i.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, i.AD_Client_ID)) ")
|
||||
.append("WHERE C_Country_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Set Country=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_BPartner "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' "
|
||||
+ "WHERE C_Country_ID IS NULL AND (City IS NOT NULL OR Address1 IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ")
|
||||
.append("WHERE C_Country_ID IS NULL AND (City IS NOT NULL OR Address1 IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.config("Invalid Country=" + no);
|
||||
|
||||
// Set Region
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "Set RegionName=(SELECT MAX(Name) FROM C_Region r"
|
||||
+ " WHERE r.IsDefault='Y' AND r.C_Country_ID=i.C_Country_ID"
|
||||
+ " AND r.AD_Client_ID IN (0, i.AD_Client_ID)) " );
|
||||
sql.append("WHERE RegionName IS NULL AND C_Region_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("Set RegionName=(SELECT MAX(Name) FROM C_Region r")
|
||||
.append(" WHERE r.IsDefault='Y' AND r.C_Country_ID=i.C_Country_ID")
|
||||
.append(" AND r.AD_Client_ID IN (0, i.AD_Client_ID)) " );
|
||||
sql.append("WHERE RegionName IS NULL AND C_Region_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Set Region Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r"
|
||||
+ " WHERE r.Name=i.RegionName AND r.C_Country_ID=i.C_Country_ID"
|
||||
+ " AND r.AD_Client_ID IN (0, i.AD_Client_ID)) "
|
||||
+ "WHERE C_Region_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r")
|
||||
.append(" WHERE r.Name=i.RegionName AND r.C_Country_ID=i.C_Country_ID")
|
||||
.append(" AND r.AD_Client_ID IN (0, i.AD_Client_ID)) ")
|
||||
.append("WHERE C_Region_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Set Region=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' "
|
||||
+ "WHERE C_Region_ID IS NULL "
|
||||
+ " AND EXISTS (SELECT * FROM C_Country c"
|
||||
+ " WHERE c.C_Country_ID=i.C_Country_ID AND c.HasRegion='Y')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ")
|
||||
.append("WHERE C_Region_ID IS NULL ")
|
||||
.append(" AND EXISTS (SELECT * FROM C_Country c")
|
||||
.append(" WHERE c.C_Country_ID=i.C_Country_ID AND c.HasRegion='Y')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.config("Invalid Region=" + no);
|
||||
|
||||
// Set Greeting
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET C_Greeting_ID=(SELECT C_Greeting_ID FROM C_Greeting g"
|
||||
+ " WHERE i.BPContactGreeting=g.Name AND g.AD_Client_ID IN (0, i.AD_Client_ID)) "
|
||||
+ "WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET C_Greeting_ID=(SELECT C_Greeting_ID FROM C_Greeting g")
|
||||
.append(" WHERE i.BPContactGreeting=g.Name AND g.AD_Client_ID IN (0, i.AD_Client_ID)) ")
|
||||
.append("WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Set Greeting=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Greeting, ' "
|
||||
+ "WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Greeting, ' ")
|
||||
.append("WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.config("Invalid Greeting=" + no);
|
||||
|
||||
// Existing User ?
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET (C_BPartner_ID,AD_User_ID)="
|
||||
+ "(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u "
|
||||
+ "WHERE i.EMail=u.EMail AND u.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE i.EMail IS NOT NULL AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET (C_BPartner_ID,AD_User_ID)=")
|
||||
.append("(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u ")
|
||||
.append("WHERE i.EMail=u.EMail AND u.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE i.EMail IS NOT NULL AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Found EMail User=" + no);
|
||||
|
||||
// Existing BPartner ? Match Value
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p"
|
||||
+ " WHERE i.Value=p.Value AND p.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND Value IS NOT NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p")
|
||||
.append(" WHERE i.Value=p.Value AND p.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND Value IS NOT NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Found BPartner=" + no);
|
||||
|
||||
// Existing Contact ? Match Name
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET AD_User_ID=(SELECT AD_User_ID FROM AD_User c"
|
||||
+ " WHERE i.ContactName=c.Name AND i.C_BPartner_ID=c.C_BPartner_ID AND c.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND AD_User_ID IS NULL AND ContactName IS NOT NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET AD_User_ID=(SELECT AD_User_ID FROM AD_User c")
|
||||
.append(" WHERE i.ContactName=c.Name AND i.C_BPartner_ID=c.C_BPartner_ID AND c.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND AD_User_ID IS NULL AND ContactName IS NOT NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Found Contact=" + no);
|
||||
|
||||
// Existing Location ? Exact Match
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID"
|
||||
+ " FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)"
|
||||
+ " WHERE i.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND (i.Address1=l.Address1 OR (i.Address1 IS NULL AND l.Address1 IS NULL))"
|
||||
+ " AND (i.Address2=l.Address2 OR (i.Address2 IS NULL AND l.Address2 IS NULL))"
|
||||
+ " AND (i.City=l.City OR (i.City IS NULL AND l.City IS NULL))"
|
||||
+ " AND (i.Postal=l.Postal OR (i.Postal IS NULL AND l.Postal IS NULL))"
|
||||
+ " AND (i.Postal_Add=l.Postal_Add OR (l.Postal_Add IS NULL AND l.Postal_Add IS NULL))"
|
||||
+ " AND (i.C_Region_ID=l.C_Region_ID OR (l.C_Region_ID IS NULL AND i.C_Region_ID IS NULL))"
|
||||
+ " AND i.C_Country_ID=l.C_Country_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID")
|
||||
.append(" FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)")
|
||||
.append(" WHERE i.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=i.AD_Client_ID")
|
||||
.append(" AND (i.Address1=l.Address1 OR (i.Address1 IS NULL AND l.Address1 IS NULL))")
|
||||
.append(" AND (i.Address2=l.Address2 OR (i.Address2 IS NULL AND l.Address2 IS NULL))")
|
||||
.append(" AND (i.City=l.City OR (i.City IS NULL AND l.City IS NULL))")
|
||||
.append(" AND (i.Postal=l.Postal OR (i.Postal IS NULL AND l.Postal IS NULL))")
|
||||
.append(" AND (i.Postal_Add=l.Postal_Add OR (l.Postal_Add IS NULL AND l.Postal_Add IS NULL))")
|
||||
.append(" AND (i.C_Region_ID=l.C_Region_ID OR (l.C_Region_ID IS NULL AND i.C_Region_ID IS NULL))")
|
||||
.append(" AND i.C_Country_ID=l.C_Country_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Found Location=" + no);
|
||||
|
||||
// Interest Area
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET R_InterestArea_ID=(SELECT R_InterestArea_ID FROM R_InterestArea ia "
|
||||
+ "WHERE i.InterestAreaName=ia.Name AND ia.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE R_InterestArea_ID IS NULL AND InterestAreaName IS NOT NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET R_InterestArea_ID=(SELECT R_InterestArea_ID FROM R_InterestArea ia ")
|
||||
.append("WHERE i.InterestAreaName=ia.Name AND ia.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE R_InterestArea_ID IS NULL AND InterestAreaName IS NOT NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Set Interest Area=" + no);
|
||||
|
||||
// Value is mandatory error
|
||||
sql = new StringBuffer ("UPDATE I_BPartner "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Value is mandatory, ' "
|
||||
+ "WHERE Value IS NULL "
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Value is mandatory, ' ")
|
||||
.append("WHERE Value IS NULL ")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.config("Value is mandatory=" + no);
|
||||
|
||||
|
@ -290,8 +290,8 @@ implements ImportProcess
|
|||
int noUpdate = 0;
|
||||
|
||||
// Go through Records
|
||||
sql = new StringBuffer ("SELECT * FROM I_BPartner "
|
||||
+ "WHERE I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("SELECT * FROM I_BPartner ")
|
||||
.append("WHERE I_IsImported='N'").append(clientCheck);
|
||||
// gody: 20070113 - Order so the same values are consecutive.
|
||||
sql.append(" ORDER BY Value, I_BPartner_ID");
|
||||
PreparedStatement pstmt = null;
|
||||
|
@ -313,11 +313,12 @@ implements ImportProcess
|
|||
// Remember Value - only first occurance of the value is BP
|
||||
String New_BPValue = rs.getString("Value") ;
|
||||
|
||||
X_I_BPartner impBP = new X_I_BPartner (getCtx(), rs, get_TrxName());
|
||||
log.fine("I_BPartner_ID=" + impBP.getI_BPartner_ID()
|
||||
+ ", C_BPartner_ID=" + impBP.getC_BPartner_ID()
|
||||
+ ", C_BPartner_Location_ID=" + impBP.getC_BPartner_Location_ID()
|
||||
+ ", AD_User_ID=" + impBP.getAD_User_ID());
|
||||
X_I_BPartner impBP = new X_I_BPartner (getCtx(), rs, get_TrxName());
|
||||
StringBuilder msglog = new StringBuilder("I_BPartner_ID=") .append(impBP.getI_BPartner_ID())
|
||||
.append(", C_BPartner_ID=").append(impBP.getC_BPartner_ID())
|
||||
.append(", C_BPartner_Location_ID=").append(impBP.getC_BPartner_Location_ID())
|
||||
.append(", AD_User_ID=").append(impBP.getAD_User_ID());
|
||||
log.fine(msglog.toString());
|
||||
|
||||
|
||||
if ( ! New_BPValue.equals(Old_BPValue)) {
|
||||
|
@ -333,14 +334,15 @@ implements ImportProcess
|
|||
|
||||
if (bp.save())
|
||||
{
|
||||
impBP.setC_BPartner_ID(bp.getC_BPartner_ID());
|
||||
log.finest("Insert BPartner - " + bp.getC_BPartner_ID());
|
||||
impBP.setC_BPartner_ID(bp.getC_BPartner_ID());
|
||||
msglog = new StringBuilder("Insert BPartner - ").append(bp.getC_BPartner_ID());
|
||||
log.finest(msglog.toString());
|
||||
noInsert++;
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
.append("'Cannot Insert BPartner, ' ")
|
||||
.append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID());
|
||||
DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
@ -374,13 +376,14 @@ implements ImportProcess
|
|||
//
|
||||
if (bp.save())
|
||||
{
|
||||
log.finest("Update BPartner - " + bp.getC_BPartner_ID());
|
||||
msglog = new StringBuilder("Update BPartner - ").append(bp.getC_BPartner_ID());
|
||||
log.finest(msglog.toString());
|
||||
noUpdate++;
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
.append("'Cannot Update BPartner, ' ")
|
||||
.append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID());
|
||||
DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
@ -425,14 +428,16 @@ implements ImportProcess
|
|||
location.setAddress2(impBP.getAddress2());
|
||||
location.setPostal(impBP.getPostal());
|
||||
location.setPostal_Add(impBP.getPostal_Add());
|
||||
if (location.save())
|
||||
log.finest("Insert Location - " + location.getC_Location_ID());
|
||||
if (location.save()){
|
||||
msglog = new StringBuilder("Insert Location - ").append(location.getC_Location_ID());
|
||||
log.finest(msglog.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
rollback();
|
||||
noInsert--;
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
.append("'Cannot Insert Location, ' ")
|
||||
.append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID());
|
||||
DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
@ -447,15 +452,16 @@ implements ImportProcess
|
|||
ModelValidationEngine.get().fireImportValidate(this, impBP, bpl, ImportValidator.TIMING_AFTER_IMPORT);
|
||||
if (bpl.save())
|
||||
{
|
||||
log.finest("Insert BP Location - " + bpl.getC_BPartner_Location_ID());
|
||||
msglog = new StringBuilder("Insert BP Location - ").append(bpl.getC_BPartner_Location_ID());
|
||||
log.finest(msglog.toString());
|
||||
impBP.setC_BPartner_Location_ID(bpl.getC_BPartner_Location_ID());
|
||||
}
|
||||
else
|
||||
{
|
||||
rollback();
|
||||
noInsert--;
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
.append("'Cannot Insert BPLocation, ' ")
|
||||
.append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID());
|
||||
DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
@ -477,8 +483,8 @@ implements ImportProcess
|
|||
{
|
||||
rollback();
|
||||
noInsert--;
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
.append("'BP of User <> BP, ' ")
|
||||
.append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID());
|
||||
DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
@ -511,14 +517,15 @@ implements ImportProcess
|
|||
ModelValidationEngine.get().fireImportValidate(this, impBP, user, ImportValidator.TIMING_AFTER_IMPORT);
|
||||
if (user.save())
|
||||
{
|
||||
log.finest("Update BP Contact - " + user.getAD_User_ID());
|
||||
msglog = new StringBuilder("Update BP Contact - ").append(user.getAD_User_ID());
|
||||
log.finest(msglog.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
rollback();
|
||||
noInsert--;
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
.append("'Cannot Update BP Contact, ' ")
|
||||
.append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID());
|
||||
DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
@ -548,15 +555,16 @@ implements ImportProcess
|
|||
ModelValidationEngine.get().fireImportValidate(this, impBP, user, ImportValidator.TIMING_AFTER_IMPORT);
|
||||
if (user.save())
|
||||
{
|
||||
log.finest("Insert BP Contact - " + user.getAD_User_ID());
|
||||
msglog = new StringBuilder("Insert BP Contact - ").append(user.getAD_User_ID());
|
||||
log.finest(msglog.toString());
|
||||
impBP.setAD_User_ID(user.getAD_User_ID());
|
||||
}
|
||||
else
|
||||
{
|
||||
rollback();
|
||||
noInsert--;
|
||||
sql = new StringBuffer ("UPDATE I_BPartner i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
sql = new StringBuilder ("UPDATE I_BPartner i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||")
|
||||
.append("'Cannot Insert BPContact, ' ")
|
||||
.append("WHERE I_BPartner_ID=").append(impBP.getI_BPartner_ID());
|
||||
DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
@ -592,9 +600,9 @@ implements ImportProcess
|
|||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_BPartner "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BPartner ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
addLog (0, null, new BigDecimal (noInsert), "@C_BPartner_ID@: @Inserted@");
|
||||
|
@ -607,7 +615,8 @@ implements ImportProcess
|
|||
//@Override
|
||||
public String getWhereClause()
|
||||
{
|
||||
return " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
StringBuilder msgreturn = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID);
|
||||
return msgreturn.toString();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -82,249 +82,250 @@ public class ImportBankStatement extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("AD_Org_ID=" + p_AD_Org_ID + ", C_BankAccount_ID" + p_C_BankAccount_ID);
|
||||
StringBuffer sql = null;
|
||||
StringBuilder msglog = new StringBuilder("AD_Org_ID=").append(p_AD_Org_ID).append(", C_BankAccount_ID").append(p_C_BankAccount_ID);
|
||||
log.info(msglog.toString());
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + p_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(p_AD_Client_ID);
|
||||
|
||||
// **** Prepare ****
|
||||
|
||||
// Delete Old Imported
|
||||
if (p_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_BankStatement "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_BankStatement ")
|
||||
.append("WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_BankStatement "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),");
|
||||
sql.append(" IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL OR AD_Client_ID IS NULL OR AD_Org_ID IS NULL OR AD_Client_ID=0 OR AD_Org_ID=0");
|
||||
sql = new StringBuilder ("UPDATE I_BankStatement ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),");
|
||||
sql.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL OR AD_Client_ID IS NULL OR AD_Org_ID IS NULL OR AD_Client_ID=0 OR AD_Org_ID=0");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info ("Reset=" + no);
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_BankStatement o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '"
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BankStatement o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '")
|
||||
.append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0")
|
||||
.append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Org=" + no);
|
||||
|
||||
// Set Bank Account
|
||||
sql = new StringBuffer("UPDATE I_BankStatement i "
|
||||
+ "SET C_BankAccount_ID="
|
||||
+ "( "
|
||||
+ " SELECT C_BankAccount_ID "
|
||||
+ " FROM C_BankAccount a, C_Bank b "
|
||||
+ " WHERE b.IsOwnBank='Y' "
|
||||
+ " AND a.AD_Client_ID=i.AD_Client_ID "
|
||||
+ " AND a.C_Bank_ID=b.C_Bank_ID "
|
||||
+ " AND a.AccountNo=i.BankAccountNo "
|
||||
+ " AND b.RoutingNo=i.RoutingNo "
|
||||
+ " OR b.SwiftCode=i.RoutingNo "
|
||||
+ ") "
|
||||
+ "WHERE i.C_BankAccount_ID IS NULL "
|
||||
+ "AND i.I_IsImported<>'Y' "
|
||||
+ "OR i.I_IsImported IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement i ")
|
||||
.append("SET C_BankAccount_ID=")
|
||||
.append("( ")
|
||||
.append(" SELECT C_BankAccount_ID ")
|
||||
.append(" FROM C_BankAccount a, C_Bank b ")
|
||||
.append(" WHERE b.IsOwnBank='Y' ")
|
||||
.append(" AND a.AD_Client_ID=i.AD_Client_ID ")
|
||||
.append(" AND a.C_Bank_ID=b.C_Bank_ID ")
|
||||
.append(" AND a.AccountNo=i.BankAccountNo ")
|
||||
.append(" AND b.RoutingNo=i.RoutingNo ")
|
||||
.append(" OR b.SwiftCode=i.RoutingNo ")
|
||||
.append(") ")
|
||||
.append("WHERE i.C_BankAccount_ID IS NULL ")
|
||||
.append("AND i.I_IsImported<>'Y' ")
|
||||
.append("OR i.I_IsImported IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Bank Account (With Routing No)=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_BankStatement i "
|
||||
+ "SET C_BankAccount_ID="
|
||||
+ "( "
|
||||
+ " SELECT C_BankAccount_ID "
|
||||
+ " FROM C_BankAccount a, C_Bank b "
|
||||
+ " WHERE b.IsOwnBank='Y' "
|
||||
+ " AND a.C_Bank_ID=b.C_Bank_ID "
|
||||
+ " AND a.AccountNo=i.BankAccountNo "
|
||||
+ " AND a.AD_Client_ID=i.AD_Client_ID "
|
||||
+ ") "
|
||||
+ "WHERE i.C_BankAccount_ID IS NULL "
|
||||
+ "AND i.I_isImported<>'Y' "
|
||||
+ "OR i.I_isImported IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement i ")
|
||||
.append("SET C_BankAccount_ID=")
|
||||
.append("( ")
|
||||
.append(" SELECT C_BankAccount_ID ")
|
||||
.append(" FROM C_BankAccount a, C_Bank b ")
|
||||
.append(" WHERE b.IsOwnBank='Y' ")
|
||||
.append(" AND a.C_Bank_ID=b.C_Bank_ID ")
|
||||
.append(" AND a.AccountNo=i.BankAccountNo ")
|
||||
.append(" AND a.AD_Client_ID=i.AD_Client_ID ")
|
||||
.append(") ")
|
||||
.append("WHERE i.C_BankAccount_ID IS NULL ")
|
||||
.append("AND i.I_isImported<>'Y' ")
|
||||
.append("OR i.I_isImported IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Bank Account (Without Routing No)=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_BankStatement i "
|
||||
+ "SET C_BankAccount_ID=(SELECT C_BankAccount_ID FROM C_BankAccount a WHERE a.C_BankAccount_ID=").append(p_C_BankAccount_ID);
|
||||
sql.append(" and a.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE i.C_BankAccount_ID IS NULL "
|
||||
+ "AND i.BankAccountNo IS NULL "
|
||||
+ "AND i.I_isImported<>'Y' "
|
||||
+ "OR i.I_isImported IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement i ")
|
||||
.append("SET C_BankAccount_ID=(SELECT C_BankAccount_ID FROM C_BankAccount a WHERE a.C_BankAccount_ID=").append(p_C_BankAccount_ID)
|
||||
.append(" and a.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE i.C_BankAccount_ID IS NULL ")
|
||||
.append("AND i.BankAccountNo IS NULL ")
|
||||
.append("AND i.I_isImported<>'Y' ")
|
||||
.append("OR i.I_isImported IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Bank Account=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Bank Account, ' "
|
||||
+ "WHERE C_BankAccount_ID IS NULL "
|
||||
+ "AND I_isImported<>'Y' "
|
||||
+ "OR I_isImported IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Bank Account, ' ")
|
||||
.append("WHERE C_BankAccount_ID IS NULL ")
|
||||
.append("AND I_isImported<>'Y' ")
|
||||
.append("OR I_isImported IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid Bank Account=" + no);
|
||||
|
||||
// Set Currency
|
||||
sql = new StringBuffer ("UPDATE I_BankStatement i "
|
||||
+ "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_Currency_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BankStatement i ")
|
||||
.append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c")
|
||||
.append(" WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ")
|
||||
.append("WHERE C_Currency_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Set Currency=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_BankStatement i "
|
||||
+ "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=i.C_BankAccount_ID) "
|
||||
+ "WHERE i.C_Currency_ID IS NULL "
|
||||
+ "AND i.ISO_Code IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement i ")
|
||||
.append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=i.C_BankAccount_ID) ")
|
||||
.append("WHERE i.C_Currency_ID IS NULL ")
|
||||
.append("AND i.ISO_Code IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Set Currency=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_BankStatement "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency,' "
|
||||
+ "WHERE C_Currency_ID IS NULL "
|
||||
+ "AND I_IsImported<>'E' "
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BankStatement ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency,' ")
|
||||
.append("WHERE C_Currency_ID IS NULL ")
|
||||
.append("AND I_IsImported<>'E' ")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid Currency=" + no);
|
||||
|
||||
|
||||
// Set Amount
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET ChargeAmt=0 "
|
||||
+ "WHERE ChargeAmt IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET ChargeAmt=0 ")
|
||||
.append("WHERE ChargeAmt IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Charge Amount=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET InterestAmt=0 "
|
||||
+ "WHERE InterestAmt IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET InterestAmt=0 ")
|
||||
.append("WHERE InterestAmt IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Interest Amount=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET TrxAmt=StmtAmt - InterestAmt - ChargeAmt "
|
||||
+ "WHERE TrxAmt IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET TrxAmt=StmtAmt - InterestAmt - ChargeAmt ")
|
||||
.append("WHERE TrxAmt IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Transaction Amount=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Amount, ' "
|
||||
+ "WHERE TrxAmt + ChargeAmt + InterestAmt <> StmtAmt "
|
||||
+ "AND I_isImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Amount, ' ")
|
||||
.append("WHERE TrxAmt + ChargeAmt + InterestAmt <> StmtAmt ")
|
||||
.append("AND I_isImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Invaid Amount=" + no);
|
||||
|
||||
// Set Valuta Date
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET ValutaDate=StatementLineDate "
|
||||
+ "WHERE ValutaDate IS NULL "
|
||||
+ "AND I_isImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET ValutaDate=StatementLineDate ")
|
||||
.append("WHERE ValutaDate IS NULL ")
|
||||
.append("AND I_isImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Valuta Date=" + no);
|
||||
|
||||
// Check Payment<->Invoice combination
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->Invoice, ' "
|
||||
+ "WHERE I_BankStatement_ID IN "
|
||||
+ "(SELECT I_BankStatement_ID "
|
||||
+ "FROM I_BankStatement i"
|
||||
+ " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) "
|
||||
+ "WHERE i.C_Invoice_ID IS NOT NULL "
|
||||
+ " AND p.C_Invoice_ID IS NOT NULL "
|
||||
+ " AND p.C_Invoice_ID<>i.C_Invoice_ID) ")
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->Invoice, ' ")
|
||||
.append("WHERE I_BankStatement_ID IN ")
|
||||
.append("(SELECT I_BankStatement_ID ")
|
||||
.append("FROM I_BankStatement i")
|
||||
.append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ")
|
||||
.append("WHERE i.C_Invoice_ID IS NOT NULL ")
|
||||
.append(" AND p.C_Invoice_ID IS NOT NULL ")
|
||||
.append(" AND p.C_Invoice_ID<>i.C_Invoice_ID) ")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Payment<->Invoice Mismatch=" + no);
|
||||
|
||||
// Check Payment<->BPartner combination
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->BPartner, ' "
|
||||
+ "WHERE I_BankStatement_ID IN "
|
||||
+ "(SELECT I_BankStatement_ID "
|
||||
+ "FROM I_BankStatement i"
|
||||
+ " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) "
|
||||
+ "WHERE i.C_BPartner_ID IS NOT NULL "
|
||||
+ " AND p.C_BPartner_ID IS NOT NULL "
|
||||
+ " AND p.C_BPartner_ID<>i.C_BPartner_ID) ")
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->BPartner, ' ")
|
||||
.append("WHERE I_BankStatement_ID IN ")
|
||||
.append("(SELECT I_BankStatement_ID ")
|
||||
.append("FROM I_BankStatement i")
|
||||
.append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ")
|
||||
.append("WHERE i.C_BPartner_ID IS NOT NULL ")
|
||||
.append(" AND p.C_BPartner_ID IS NOT NULL ")
|
||||
.append(" AND p.C_BPartner_ID<>i.C_BPartner_ID) ")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Payment<->BPartner Mismatch=" + no);
|
||||
|
||||
// Check Invoice<->BPartner combination
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice<->BPartner, ' "
|
||||
+ "WHERE I_BankStatement_ID IN "
|
||||
+ "(SELECT I_BankStatement_ID "
|
||||
+ "FROM I_BankStatement i"
|
||||
+ " INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID) "
|
||||
+ "WHERE i.C_BPartner_ID IS NOT NULL "
|
||||
+ " AND v.C_BPartner_ID IS NOT NULL "
|
||||
+ " AND v.C_BPartner_ID<>i.C_BPartner_ID) ")
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice<->BPartner, ' ")
|
||||
.append("WHERE I_BankStatement_ID IN ")
|
||||
.append("(SELECT I_BankStatement_ID ")
|
||||
.append("FROM I_BankStatement i")
|
||||
.append(" INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID) ")
|
||||
.append("WHERE i.C_BPartner_ID IS NOT NULL ")
|
||||
.append(" AND v.C_BPartner_ID IS NOT NULL ")
|
||||
.append(" AND v.C_BPartner_ID<>i.C_BPartner_ID) ")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Invoice<->BPartner Mismatch=" + no);
|
||||
|
||||
// Check Invoice.BPartner<->Payment.BPartner combination
|
||||
sql = new StringBuffer("UPDATE I_BankStatement "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice.BPartner<->Payment.BPartner, ' "
|
||||
+ "WHERE I_BankStatement_ID IN "
|
||||
+ "(SELECT I_BankStatement_ID "
|
||||
+ "FROM I_BankStatement i"
|
||||
+ " INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID)"
|
||||
+ " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) "
|
||||
+ "WHERE p.C_Invoice_ID<>v.C_Invoice_ID"
|
||||
+ " AND v.C_BPartner_ID<>p.C_BPartner_ID) ")
|
||||
sql = new StringBuilder("UPDATE I_BankStatement ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice.BPartner<->Payment.BPartner, ' ")
|
||||
.append("WHERE I_BankStatement_ID IN ")
|
||||
.append("(SELECT I_BankStatement_ID ")
|
||||
.append("FROM I_BankStatement i")
|
||||
.append(" INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID)")
|
||||
.append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ")
|
||||
.append("WHERE p.C_Invoice_ID<>v.C_Invoice_ID")
|
||||
.append(" AND v.C_BPartner_ID<>p.C_BPartner_ID) ")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Invoice.BPartner<->Payment.BPartner Mismatch=" + no);
|
||||
|
||||
// Detect Duplicates
|
||||
sql = new StringBuffer("SELECT i.I_BankStatement_ID, l.C_BankStatementLine_ID, i.EftTrxID "
|
||||
+ "FROM I_BankStatement i, C_BankStatement s, C_BankStatementLine l "
|
||||
+ "WHERE i.I_isImported='N' "
|
||||
+ "AND s.C_BankStatement_ID=l.C_BankStatement_ID "
|
||||
+ "AND i.EftTrxID IS NOT NULL AND "
|
||||
sql = new StringBuilder("SELECT i.I_BankStatement_ID, l.C_BankStatementLine_ID, i.EftTrxID ")
|
||||
.append("FROM I_BankStatement i, C_BankStatement s, C_BankStatementLine l ")
|
||||
.append("WHERE i.I_isImported='N' ")
|
||||
.append("AND s.C_BankStatement_ID=l.C_BankStatement_ID ")
|
||||
.append("AND i.EftTrxID IS NOT NULL AND ")
|
||||
// Concatenate EFT Info
|
||||
+ "(l.EftTrxID||l.EftAmt||l.EftStatementLineDate||l.EftValutaDate||l.EftTrxType||l.EftCurrency||l.EftReference||s.EftStatementReference "
|
||||
+ "||l.EftCheckNo||l.EftMemo||l.EftPayee||l.EftPayeeAccount) "
|
||||
+ "= "
|
||||
+ "(i.EftTrxID||i.EftAmt||i.EftStatementLineDate||i.EftValutaDate||i.EftTrxType||i.EftCurrency||i.EftReference||i.EftStatementReference "
|
||||
+ "||i.EftCheckNo||i.EftMemo||i.EftPayee||i.EftPayeeAccount) ");
|
||||
.append("(l.EftTrxID||l.EftAmt||l.EftStatementLineDate||l.EftValutaDate||l.EftTrxType||l.EftCurrency||l.EftReference||s.EftStatementReference ")
|
||||
.append("||l.EftCheckNo||l.EftMemo||l.EftPayee||l.EftPayeeAccount) ")
|
||||
.append("= ")
|
||||
.append("(i.EftTrxID||i.EftAmt||i.EftStatementLineDate||i.EftValutaDate||i.EftTrxType||i.EftCurrency||i.EftReference||i.EftStatementReference ")
|
||||
.append("||i.EftCheckNo||i.EftMemo||i.EftPayee||i.EftPayeeAccount) ");
|
||||
|
||||
StringBuffer updateSql = new StringBuffer("UPDATE I_Bankstatement "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Duplicate['||?||']' "
|
||||
+ "WHERE I_BankStatement_ID=?").append(clientCheck);
|
||||
StringBuilder updateSql = new StringBuilder("UPDATE I_Bankstatement ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Duplicate['||?||']' ")
|
||||
.append("WHERE I_BankStatement_ID=?").append(clientCheck);
|
||||
PreparedStatement pupdt = DB.prepareStatement(updateSql.toString(), get_TrxName());
|
||||
|
||||
PreparedStatement pstmtDuplicates = null;
|
||||
|
@ -335,9 +336,9 @@ public class ImportBankStatement extends SvrProcess
|
|||
ResultSet rs = pstmtDuplicates.executeQuery();
|
||||
while (rs.next())
|
||||
{
|
||||
String info = "Line_ID=" + rs.getInt(2) // l.C_BankStatementLine_ID
|
||||
+ ",EDTTrxID=" + rs.getString(3); // i.EftTrxID
|
||||
pupdt.setString(1, info);
|
||||
StringBuilder info = new StringBuilder("Line_ID=").append(rs.getInt(2)) // l.C_BankStatementLine_ID
|
||||
.append(",EDTTrxID=").append(rs.getString(3)); // i.EftTrxID
|
||||
pupdt.setString(1, info.toString());
|
||||
pupdt.setInt(2, rs.getInt(1)); // i.I_BankStatement_ID
|
||||
pupdt.executeUpdate();
|
||||
no++;
|
||||
|
@ -360,9 +361,9 @@ public class ImportBankStatement extends SvrProcess
|
|||
commitEx();
|
||||
|
||||
//Import Bank Statement
|
||||
sql = new StringBuffer("SELECT * FROM I_BankStatement"
|
||||
+ " WHERE I_IsImported='N'"
|
||||
+ " ORDER BY C_BankAccount_ID, Name, EftStatementDate, EftStatementReference");
|
||||
sql = new StringBuilder("SELECT * FROM I_BankStatement")
|
||||
.append(" WHERE I_IsImported='N'")
|
||||
.append(" ORDER BY C_BankAccount_ID, Name, EftStatementDate, EftStatementReference");
|
||||
|
||||
MBankStatement statement = null;
|
||||
MBankAccount account = null;
|
||||
|
@ -383,14 +384,16 @@ public class ImportBankStatement extends SvrProcess
|
|||
{
|
||||
account = MBankAccount.get (m_ctx, imp.getC_BankAccount_ID());
|
||||
statement = null;
|
||||
log.info("New Statement, Account=" + account.getAccountNo());
|
||||
msglog = new StringBuilder("New Statement, Account=").append(account.getAccountNo());
|
||||
log.info(msglog.toString());
|
||||
}
|
||||
// Create a new Bank Statement for every account
|
||||
else if (account.getC_BankAccount_ID() != imp.getC_BankAccount_ID())
|
||||
{
|
||||
account = MBankAccount.get (m_ctx, imp.getC_BankAccount_ID());
|
||||
statement = null;
|
||||
log.info("New Statement, Account=" + account.getAccountNo());
|
||||
msglog = new StringBuilder("New Statement, Account=").append(account.getAccountNo());
|
||||
log.info(msglog.toString());
|
||||
}
|
||||
// Create a new Bank Statement for every statement name
|
||||
else if ((statement.getName() != null) && (imp.getName() != null))
|
||||
|
@ -398,7 +401,8 @@ public class ImportBankStatement extends SvrProcess
|
|||
if (!statement.getName().equals(imp.getName()))
|
||||
{
|
||||
statement = null;
|
||||
log.info("New Statement, Statement Name=" + imp.getName());
|
||||
msglog = new StringBuilder("New Statement, Statement Name=").append(imp.getName());
|
||||
log.info(msglog.toString());
|
||||
}
|
||||
}
|
||||
// Create a new Bank Statement for every statement reference
|
||||
|
@ -407,7 +411,8 @@ public class ImportBankStatement extends SvrProcess
|
|||
if (!statement.getEftStatementReference().equals(imp.getEftStatementReference()))
|
||||
{
|
||||
statement = null;
|
||||
log.info("New Statement, Statement Reference=" + imp.getEftStatementReference());
|
||||
msglog = new StringBuilder("New Statement, Statement Reference=").append(imp.getEftStatementReference());
|
||||
log.info(msglog.toString());
|
||||
}
|
||||
}
|
||||
// Create a new Bank Statement for every statement date
|
||||
|
@ -416,7 +421,8 @@ public class ImportBankStatement extends SvrProcess
|
|||
if (!statement.getStatementDate().equals(imp.getStatementDate()))
|
||||
{
|
||||
statement = null;
|
||||
log.info("New Statement, Statement Date=" + imp.getStatementDate());
|
||||
msglog = new StringBuilder("New Statement, Statement Date=").append(imp.getStatementDate());
|
||||
log.info(msglog.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -513,9 +519,9 @@ public class ImportBankStatement extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_BankStatement "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_BankStatement ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
//
|
||||
|
|
|
@ -84,138 +84,139 @@ public class ImportConversionRate extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws Exception
|
||||
{
|
||||
log.info("doIt - AD_Client_ID=" + p_AD_Client_ID
|
||||
+ ",AD_Org_ID=" + p_AD_Org_ID
|
||||
+ ",C_ConversionType_ID=" + p_C_ConversionType_ID
|
||||
+ ",ValidFrom=" + p_ValidFrom
|
||||
+ ",CreateReciprocalRate=" + p_CreateReciprocalRate);
|
||||
StringBuilder msglog = new StringBuilder("doIt - AD_Client_ID=").append(p_AD_Client_ID)
|
||||
.append(",AD_Org_ID=").append(p_AD_Org_ID)
|
||||
.append(",C_ConversionType_ID=").append(p_C_ConversionType_ID)
|
||||
.append(",ValidFrom=").append(p_ValidFrom)
|
||||
.append(",CreateReciprocalRate=").append(p_CreateReciprocalRate);
|
||||
log.info(msglog.toString());
|
||||
//
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + p_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(p_AD_Client_ID);
|
||||
// **** Prepare ****
|
||||
|
||||
// Delete Old Imported
|
||||
if (p_DeleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_Conversion_Rate "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_Conversion_Rate ")
|
||||
.append("WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, Location, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),");
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),");
|
||||
if (p_C_ConversionType_ID != 0)
|
||||
sql.append(" C_ConversionType_ID = COALESCE (C_ConversionType_ID,").append (p_C_ConversionType_ID).append ("),");
|
||||
if (p_ValidFrom != null)
|
||||
sql.append(" ValidFrom = COALESCE (ValidFrom,").append (DB.TO_DATE(p_ValidFrom)).append ("),");
|
||||
else
|
||||
sql.append(" ValidFrom = COALESCE (ValidFrom,SysDate),");
|
||||
sql.append(" CreateReciprocalRate = COALESCE (CreateReciprocalRate,'").append (p_CreateReciprocalRate ? "Y" : "N").append ("'),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = ").append(getAD_User_ID()).append(","
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " Processed = 'N',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql.append(" CreateReciprocalRate = COALESCE (CreateReciprocalRate,'").append (p_CreateReciprocalRate ? "Y" : "N").append ("'),")
|
||||
.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = ").append(getAD_User_ID()).append(",")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" Processed = 'N'," )
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info ("Reset =" + no);
|
||||
|
||||
// Org
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '"
|
||||
+ "WHERE (AD_Org_ID IS NULL"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '")
|
||||
.append("WHERE (AD_Org_ID IS NULL")
|
||||
.append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Org =" + no);
|
||||
|
||||
// Conversion Type
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET C_ConversionType_ID = (SELECT C_ConversionType_ID FROM C_ConversionType c"
|
||||
+ " WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') "
|
||||
+ "WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET C_ConversionType_ID = (SELECT C_ConversionType_ID FROM C_ConversionType c")
|
||||
.append(" WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') ")
|
||||
.append("WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.fine("Set ConversionType =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ConversionType, ' "
|
||||
+ "WHERE (C_ConversionType_ID IS NULL"
|
||||
+ " OR NOT EXISTS (SELECT * FROM C_ConversionType c "
|
||||
+ "WHERE i.C_ConversionType_ID=c.C_ConversionType_ID AND c.IsActive='Y'"
|
||||
+ " AND c.AD_Client_ID IN (0,i.AD_Client_ID)))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ConversionType, ' ")
|
||||
.append("WHERE (C_ConversionType_ID IS NULL")
|
||||
.append(" OR NOT EXISTS (SELECT * FROM C_ConversionType c ")
|
||||
.append("WHERE i.C_ConversionType_ID=c.C_ConversionType_ID AND c.IsActive='Y'")
|
||||
.append(" AND c.AD_Client_ID IN (0,i.AD_Client_ID)))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid ConversionType =" + no);
|
||||
|
||||
// Currency
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET C_Currency_ID = (SELECT C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') "
|
||||
+ "WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET C_Currency_ID = (SELECT C_Currency_ID FROM C_Currency c")
|
||||
.append(" WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') ")
|
||||
.append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.fine("Set Currency =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, ' "
|
||||
+ "WHERE (C_Currency_ID IS NULL"
|
||||
+ " OR NOT EXISTS (SELECT * FROM C_Currency c "
|
||||
+ "WHERE i.C_Currency_ID=c.C_Currency_ID AND c.IsActive='Y'"
|
||||
+ " AND c.AD_Client_ID IN (0,i.AD_Client_ID)))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, ' ")
|
||||
.append("WHERE (C_Currency_ID IS NULL")
|
||||
.append(" OR NOT EXISTS (SELECT * FROM C_Currency c ")
|
||||
.append("WHERE i.C_Currency_ID=c.C_Currency_ID AND c.IsActive='Y'")
|
||||
.append(" AND c.AD_Client_ID IN (0,i.AD_Client_ID)))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Currency =" + no);
|
||||
|
||||
// Currency To
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET C_Currency_ID_To = (SELECT C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE c.ISO_Code=i.ISO_Code_To AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') "
|
||||
+ "WHERE C_Currency_ID_To IS NULL AND ISO_Code_To IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET C_Currency_ID_To = (SELECT C_Currency_ID FROM C_Currency c")
|
||||
.append(" WHERE c.ISO_Code=i.ISO_Code_To AND c.AD_Client_ID IN (0,i.AD_Client_ID) AND c.IsActive='Y') ")
|
||||
.append("WHERE C_Currency_ID_To IS NULL AND ISO_Code_To IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.fine("Set Currency To =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency To, ' "
|
||||
+ "WHERE (C_Currency_ID_To IS NULL"
|
||||
+ " OR NOT EXISTS (SELECT * FROM C_Currency c "
|
||||
+ "WHERE i.C_Currency_ID_To=c.C_Currency_ID AND c.IsActive='Y'"
|
||||
+ " AND c.AD_Client_ID IN (0,i.AD_Client_ID)))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency To, ' ")
|
||||
.append("WHERE (C_Currency_ID_To IS NULL")
|
||||
.append(" OR NOT EXISTS (SELECT * FROM C_Currency c ")
|
||||
.append("WHERE i.C_Currency_ID_To=c.C_Currency_ID AND c.IsActive='Y'")
|
||||
.append(" AND c.AD_Client_ID IN (0,i.AD_Client_ID)))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Currency To =" + no);
|
||||
|
||||
// Rates
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET MultiplyRate = 1 / DivideRate "
|
||||
+ "WHERE (MultiplyRate IS NULL OR MultiplyRate = 0) AND DivideRate IS NOT NULL AND DivideRate<>0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET MultiplyRate = 1 / DivideRate ")
|
||||
.append("WHERE (MultiplyRate IS NULL OR MultiplyRate = 0) AND DivideRate IS NOT NULL AND DivideRate<>0")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.fine("Set MultiplyRate =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET DivideRate = 1 / MultiplyRate "
|
||||
+ "WHERE (DivideRate IS NULL OR DivideRate = 0) AND MultiplyRate IS NOT NULL AND MultiplyRate<>0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET DivideRate = 1 / MultiplyRate ")
|
||||
.append("WHERE (DivideRate IS NULL OR DivideRate = 0) AND MultiplyRate IS NOT NULL AND MultiplyRate<>0")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.fine("Set DivideRate =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Rates, ' "
|
||||
+ "WHERE (MultiplyRate IS NULL OR MultiplyRate = 0 OR DivideRate IS NULL OR DivideRate = 0)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Rates, ' ")
|
||||
.append("WHERE (MultiplyRate IS NULL OR MultiplyRate = 0 OR DivideRate IS NULL OR DivideRate = 0)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Rates =" + no);
|
||||
|
@ -231,8 +232,8 @@ public class ImportConversionRate extends SvrProcess
|
|||
/*********************************************************************/
|
||||
|
||||
int noInsert = 0;
|
||||
sql = new StringBuffer ("SELECT * FROM I_Conversion_Rate "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck)
|
||||
sql = new StringBuilder ("SELECT * FROM I_Conversion_Rate ")
|
||||
.append("WHERE I_IsImported='N'").append (clientCheck)
|
||||
.append(" ORDER BY C_Currency_ID, C_Currency_ID_To, ValidFrom");
|
||||
PreparedStatement pstmt = null;
|
||||
try
|
||||
|
@ -289,9 +290,9 @@ public class ImportConversionRate extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_Conversion_Rate "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Conversion_Rate ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
//
|
||||
|
|
|
@ -58,20 +58,25 @@ public class ImportDelete extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws Exception
|
||||
{
|
||||
log.info("AD_Table_ID=" + p_AD_Table_ID);
|
||||
StringBuilder msglog = new StringBuilder("AD_Table_ID=").append(p_AD_Table_ID);
|
||||
log.info(msglog.toString());
|
||||
// get Table Info
|
||||
MTable table = new MTable (getCtx(), p_AD_Table_ID, get_TrxName());
|
||||
if (table.get_ID() == 0)
|
||||
throw new IllegalArgumentException ("No AD_Table_ID=" + p_AD_Table_ID);
|
||||
if (table.get_ID() == 0){
|
||||
StringBuilder msgexc = new StringBuilder("No AD_Table_ID=").append(p_AD_Table_ID);
|
||||
throw new IllegalArgumentException (msgexc.toString());
|
||||
}
|
||||
String tableName = table.getTableName();
|
||||
if (!tableName.startsWith("I"))
|
||||
throw new IllegalArgumentException ("Not an import table = " + tableName);
|
||||
if (!tableName.startsWith("I")){
|
||||
StringBuilder msgexc = new StringBuilder("Not an import table = ").append(tableName);
|
||||
throw new IllegalArgumentException (msgexc.toString());
|
||||
}
|
||||
|
||||
// Delete
|
||||
String sql = "DELETE FROM " + tableName + " WHERE AD_Client_ID=" + getAD_Client_ID();
|
||||
int no = DB.executeUpdate(sql, get_TrxName());
|
||||
String msg = Msg.translate(getCtx(), tableName + "_ID") + " #" + no;
|
||||
return msg;
|
||||
StringBuilder sql = new StringBuilder("DELETE FROM ").append(tableName).append(" WHERE AD_Client_ID=").append(getAD_Client_ID());
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
StringBuilder msg = new StringBuilder(Msg.translate(getCtx(), tableName + "_ID")).append(" #").append(no);
|
||||
return msg.toString();
|
||||
} // ImportDelete
|
||||
|
||||
} // ImportDelete
|
||||
|
|
|
@ -95,271 +95,272 @@ public class ImportGLJournal extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("IsValidateOnly=" + m_IsValidateOnly + ", IsImportOnlyNoErrors=" + m_IsImportOnlyNoErrors);
|
||||
StringBuffer sql = null;
|
||||
StringBuilder msglog = new StringBuilder("IsValidateOnly=").append(m_IsValidateOnly).append(", IsImportOnlyNoErrors=").append(m_IsImportOnlyNoErrors);
|
||||
log.info(msglog.toString());
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID);
|
||||
|
||||
// **** Prepare ****
|
||||
|
||||
// Delete Old Imported
|
||||
if (m_DeleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_GLJournal "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_GLJournal ")
|
||||
.append("WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal "
|
||||
+ "SET IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal ")
|
||||
.append("SET IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info ("Reset=" + no);
|
||||
|
||||
// Set Client from Name
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET AD_Client_ID=(SELECT c.AD_Client_ID FROM AD_Client c WHERE c.Value=i.ClientValue) "
|
||||
+ "WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0) AND ClientValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'");
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET AD_Client_ID=(SELECT c.AD_Client_ID FROM AD_Client c WHERE c.Value=i.ClientValue) ")
|
||||
.append("WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0) AND ClientValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Client from Value=" + no);
|
||||
|
||||
// Set Default Client, Doc Org, AcctSchema, DatAcct
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),"
|
||||
+ " AD_OrgDoc_ID = COALESCE (AD_OrgDoc_ID,").append (m_AD_Org_ID).append ("),");
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),")
|
||||
.append(" AD_OrgDoc_ID = COALESCE (AD_OrgDoc_ID,").append (m_AD_Org_ID).append ("),");
|
||||
if (m_C_AcctSchema_ID != 0)
|
||||
sql.append(" C_AcctSchema_ID = COALESCE (C_AcctSchema_ID,").append (m_C_AcctSchema_ID).append ("),");
|
||||
if (m_DateAcct != null)
|
||||
sql.append(" DateAcct = COALESCE (DateAcct,").append (DB.TO_DATE(m_DateAcct)).append ("),");
|
||||
sql.append(" Updated = COALESCE (Updated, SysDate) "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql.append(" Updated = COALESCE (Updated, SysDate) ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Client/DocOrg/Default=" + no);
|
||||
|
||||
// Error Doc Org
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Doc Org, '"
|
||||
+ "WHERE (AD_OrgDoc_ID IS NULL OR AD_OrgDoc_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_OrgDoc_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Doc Org, '")
|
||||
.append("WHERE (AD_OrgDoc_ID IS NULL OR AD_OrgDoc_ID=0")
|
||||
.append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_OrgDoc_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Doc Org=" + no);
|
||||
|
||||
// Set AcctSchema
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_AcctSchema_ID=(SELECT a.C_AcctSchema_ID FROM C_AcctSchema a"
|
||||
+ " WHERE i.AcctSchemaName=a.Name AND i.AD_Client_ID=a.AD_Client_ID) "
|
||||
+ "WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_AcctSchema_ID=(SELECT a.C_AcctSchema_ID FROM C_AcctSchema a")
|
||||
.append(" WHERE i.AcctSchemaName=a.Name AND i.AD_Client_ID=a.AD_Client_ID) ")
|
||||
.append("WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set AcctSchema from Name=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_AcctSchema_ID=(SELECT c.C_AcctSchema1_ID FROM AD_ClientInfo c WHERE c.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_AcctSchema_ID=(SELECT c.C_AcctSchema1_ID FROM AD_ClientInfo c WHERE c.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set AcctSchema from Client=" + no);
|
||||
// Error AcctSchema
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AcctSchema, '"
|
||||
+ "WHERE (C_AcctSchema_ID IS NULL OR C_AcctSchema_ID=0"
|
||||
+ " OR NOT EXISTS (SELECT * FROM C_AcctSchema a WHERE i.AD_Client_ID=a.AD_Client_ID))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AcctSchema, '")
|
||||
.append("WHERE (C_AcctSchema_ID IS NULL OR C_AcctSchema_ID=0")
|
||||
.append(" OR NOT EXISTS (SELECT * FROM C_AcctSchema a WHERE i.AD_Client_ID=a.AD_Client_ID))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid AcctSchema=" + no);
|
||||
|
||||
// Set DateAcct (mandatory)
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET DateAcct=SysDate "
|
||||
+ "WHERE DateAcct IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET DateAcct=SysDate ")
|
||||
.append("WHERE DateAcct IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set DateAcct=" + no);
|
||||
|
||||
// Document Type
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d"
|
||||
+ " WHERE d.Name=i.DocTypeName AND d.DocBaseType='GLJ' AND i.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d")
|
||||
.append(" WHERE d.Name=i.DocTypeName AND d.DocBaseType='GLJ' AND i.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, '"
|
||||
+ "WHERE (C_DocType_ID IS NULL OR C_DocType_ID=0"
|
||||
+ " OR NOT EXISTS (SELECT * FROM C_DocType d WHERE i.AD_Client_ID=d.AD_Client_ID AND d.DocBaseType='GLJ'))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, '")
|
||||
.append("WHERE (C_DocType_ID IS NULL OR C_DocType_ID=0")
|
||||
.append(" OR NOT EXISTS (SELECT * FROM C_DocType d WHERE i.AD_Client_ID=d.AD_Client_ID AND d.DocBaseType='GLJ'))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid DocType=" + no);
|
||||
|
||||
// GL Category
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET GL_Category_ID=(SELECT c.GL_Category_ID FROM GL_Category c"
|
||||
+ " WHERE c.Name=i.CategoryName AND i.AD_Client_ID=c.AD_Client_ID) "
|
||||
+ "WHERE GL_Category_ID IS NULL AND CategoryName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET GL_Category_ID=(SELECT c.GL_Category_ID FROM GL_Category c")
|
||||
.append(" WHERE c.Name=i.CategoryName AND i.AD_Client_ID=c.AD_Client_ID) ")
|
||||
.append("WHERE GL_Category_ID IS NULL AND CategoryName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Category, '"
|
||||
+ "WHERE (GL_Category_ID IS NULL OR GL_Category_ID=0)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Category, '")
|
||||
.append("WHERE (GL_Category_ID IS NULL OR GL_Category_ID=0)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid GLCategory=" + no);
|
||||
|
||||
// Set Currency
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_Currency_ID=(SELECT c.C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_Currency_ID=(SELECT c.C_Currency_ID FROM C_Currency c")
|
||||
.append(" WHERE c.ISO_Code=i.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ")
|
||||
.append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Currency from ISO=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_Currency_ID=(SELECT a.C_Currency_ID FROM C_AcctSchema a"
|
||||
+ " WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.AD_Client_ID=i.AD_Client_ID)"
|
||||
+ "WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_Currency_ID=(SELECT a.C_Currency_ID FROM C_AcctSchema a")
|
||||
.append(" WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.AD_Client_ID=i.AD_Client_ID)")
|
||||
.append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default Currency=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, '"
|
||||
+ "WHERE (C_Currency_ID IS NULL OR C_Currency_ID=0)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, '")
|
||||
.append("WHERE (C_Currency_ID IS NULL OR C_Currency_ID=0)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Currency=" + no);
|
||||
|
||||
// Set Conversion Type
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET ConversionTypeValue='S' "
|
||||
+ "WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NULL"
|
||||
+ " AND I_IsImported='N'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET ConversionTypeValue='S' ")
|
||||
.append("WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NULL")
|
||||
.append(" AND I_IsImported='N'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set CurrencyType Value to Spot =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_ConversionType_ID=(SELECT c.C_ConversionType_ID FROM C_ConversionType c"
|
||||
+ " WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_ConversionType_ID=(SELECT c.C_ConversionType_ID FROM C_ConversionType c")
|
||||
.append(" WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ")
|
||||
.append("WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set CurrencyType from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CurrencyType, '"
|
||||
+ "WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0) AND ConversionTypeValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CurrencyType, '")
|
||||
.append("WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0) AND ConversionTypeValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid CurrencyTypeValue=" + no);
|
||||
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No ConversionType, '"
|
||||
+ "WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No ConversionType, '")
|
||||
.append("WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No CourrencyType=" + no);
|
||||
|
||||
// Set/Overwrite Home Currency Rate
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET CurrencyRate=1"
|
||||
+ "WHERE EXISTS (SELECT * FROM C_AcctSchema a"
|
||||
+ " WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.C_Currency_ID=i.C_Currency_ID)"
|
||||
+ " AND C_Currency_ID IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET CurrencyRate=1")
|
||||
.append("WHERE EXISTS (SELECT * FROM C_AcctSchema a")
|
||||
.append(" WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.C_Currency_ID=i.C_Currency_ID)")
|
||||
.append(" AND C_Currency_ID IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Home CurrencyRate=" + no);
|
||||
// Set Currency Rate
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s"
|
||||
+ " WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID"
|
||||
+ " AND r.AD_Client_ID=i.AD_Client_ID AND r.AD_Org_ID=i.AD_OrgDoc_ID"
|
||||
+ " AND r.C_ConversionType_ID=i.C_ConversionType_ID"
|
||||
+ " AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo "
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s")
|
||||
.append(" WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID")
|
||||
.append(" AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID")
|
||||
.append(" AND r.AD_Client_ID=i.AD_Client_ID AND r.AD_Org_ID=i.AD_OrgDoc_ID")
|
||||
.append(" AND r.C_ConversionType_ID=i.C_ConversionType_ID")
|
||||
.append(" AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo ")
|
||||
// ORDER BY ValidFrom DESC
|
||||
+ ") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
.append(") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Org Rate=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s"
|
||||
+ " WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID"
|
||||
+ " AND r.AD_Client_ID=i.AD_Client_ID"
|
||||
+ " AND r.C_ConversionType_ID=i.C_ConversionType_ID"
|
||||
+ " AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo "
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s")
|
||||
.append(" WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID")
|
||||
.append(" AND r.C_Currency_ID=i.C_Currency_ID AND r.C_Currency_ID_TO=s.C_Currency_ID")
|
||||
.append(" AND r.AD_Client_ID=i.AD_Client_ID")
|
||||
.append(" AND r.C_ConversionType_ID=i.C_ConversionType_ID")
|
||||
.append(" AND i.DateAcct BETWEEN r.ValidFrom AND r.ValidTo ")
|
||||
// ORDER BY ValidFrom DESC
|
||||
+ ") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
.append(") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Client Rate=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Rate, '"
|
||||
+ "WHERE CurrencyRate IS NULL OR CurrencyRate=0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Rate, '")
|
||||
.append("WHERE CurrencyRate IS NULL OR CurrencyRate=0")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No Rate=" + no);
|
||||
|
||||
// Set Period
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_Period_ID=(SELECT MAX(p.C_Period_ID) FROM C_Period p"
|
||||
+ " INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)"
|
||||
+ " INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID)"
|
||||
+ " WHERE c.AD_Client_ID=i.AD_Client_ID"
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_Period_ID=(SELECT MAX(p.C_Period_ID) FROM C_Period p")
|
||||
.append(" INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)")
|
||||
.append(" INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID)")
|
||||
.append(" WHERE c.AD_Client_ID=i.AD_Client_ID")
|
||||
// globalqss - cruiz - Bug [ 1577712 ] Financial Period Bug
|
||||
+ " AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.IsActive='Y' AND p.PeriodType='S') "
|
||||
+ "WHERE C_Period_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
.append(" AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.IsActive='Y' AND p.PeriodType='S') ")
|
||||
.append("WHERE C_Period_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Period=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Period, '"
|
||||
+ "WHERE C_Period_ID IS NULL OR C_Period_ID NOT IN"
|
||||
+ "(SELECT C_Period_ID FROM C_Period p"
|
||||
+ " INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)"
|
||||
+ " INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID) "
|
||||
+ " WHERE c.AD_Client_ID=i.AD_Client_ID"
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Period, '")
|
||||
.append("WHERE C_Period_ID IS NULL OR C_Period_ID NOT IN")
|
||||
.append("(SELECT C_Period_ID FROM C_Period p")
|
||||
.append(" INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID)")
|
||||
.append(" INNER JOIN AD_ClientInfo c ON (c.C_Calendar_ID=y.C_Calendar_ID) ")
|
||||
.append(" WHERE c.AD_Client_ID=i.AD_Client_ID")
|
||||
// globalqss - cruiz - Bug [ 1577712 ] Financial Period Bug
|
||||
+ " AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.IsActive='Y' AND p.PeriodType='S')"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
.append(" AND i.DateAcct BETWEEN p.StartDate AND p.EndDate AND p.IsActive='Y' AND p.PeriodType='S')")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Period=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_ErrorMsg=I_ErrorMsg||'WARN=Period Closed, ' "
|
||||
+ "WHERE C_Period_ID IS NOT NULL AND NOT EXISTS"
|
||||
+ " (SELECT * FROM C_PeriodControl pc WHERE pc.C_Period_ID=i.C_Period_ID AND DocBaseType='GLJ' AND PeriodStatus='O') "
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_ErrorMsg=I_ErrorMsg||'WARN=Period Closed, ' ")
|
||||
.append("WHERE C_Period_ID IS NOT NULL AND NOT EXISTS")
|
||||
.append(" (SELECT * FROM C_PeriodControl pc WHERE pc.C_Period_ID=i.C_Period_ID AND DocBaseType='GLJ' AND PeriodStatus='O') ")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Period Closed=" + no);
|
||||
|
||||
// Posting Type
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET PostingType='A' "
|
||||
+ "WHERE PostingType IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET PostingType='A' ")
|
||||
.append("WHERE PostingType IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Actual PostingType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PostingType, ' "
|
||||
+ "WHERE PostingType IS NULL OR NOT EXISTS"
|
||||
+ " (SELECT * FROM AD_Ref_List r WHERE r.AD_Reference_ID=125 AND i.PostingType=r.Value)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PostingType, ' ")
|
||||
.append("WHERE PostingType IS NULL OR NOT EXISTS")
|
||||
.append(" (SELECT * FROM AD_Ref_List r WHERE r.AD_Reference_ID=125 AND i.PostingType=r.Value)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid PostingTypee=" + no);
|
||||
|
@ -369,152 +370,152 @@ public class ImportGLJournal extends SvrProcess
|
|||
// (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0)
|
||||
|
||||
// Set Org from Name (* is overwritten and default)
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET AD_Org_ID=COALESCE((SELECT o.AD_Org_ID FROM AD_Org o"
|
||||
+ " WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID),AD_Org_ID) "
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'");
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET AD_Org_ID=COALESCE((SELECT o.AD_Org_ID FROM AD_Org o")
|
||||
.append(" WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID),AD_Org_ID) ")
|
||||
.append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NOT NULL")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Org from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET AD_Org_ID=AD_OrgDoc_ID "
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NULL AND AD_OrgDoc_ID IS NOT NULL AND AD_OrgDoc_ID<>0"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET AD_Org_ID=AD_OrgDoc_ID ")
|
||||
.append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NULL AND AD_OrgDoc_ID IS NOT NULL AND AD_OrgDoc_ID<>0")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Org from Doc Org=" + no);
|
||||
// Error Org
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '"
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '")
|
||||
.append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0")
|
||||
.append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Org=" + no);
|
||||
|
||||
// Set Account
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET Account_ID=(SELECT MAX(ev.C_ElementValue_ID) FROM C_ElementValue ev"
|
||||
+ " INNER JOIN C_Element e ON (e.C_Element_ID=ev.C_Element_ID)"
|
||||
+ " INNER JOIN C_AcctSchema_Element ase ON (e.C_Element_ID=ase.C_Element_ID AND ase.ElementType='AC')"
|
||||
+ " WHERE ev.Value=i.AccountValue AND ev.IsSummary='N'"
|
||||
+ " AND i.C_AcctSchema_ID=ase.C_AcctSchema_ID AND i.AD_Client_ID=ev.AD_Client_ID) "
|
||||
+ "WHERE Account_ID IS NULL AND AccountValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET Account_ID=(SELECT MAX(ev.C_ElementValue_ID) FROM C_ElementValue ev")
|
||||
.append(" INNER JOIN C_Element e ON (e.C_Element_ID=ev.C_Element_ID)")
|
||||
.append(" INNER JOIN C_AcctSchema_Element ase ON (e.C_Element_ID=ase.C_Element_ID AND ase.ElementType='AC')")
|
||||
.append(" WHERE ev.Value=i.AccountValue AND ev.IsSummary='N'")
|
||||
.append(" AND i.C_AcctSchema_ID=ase.C_AcctSchema_ID AND i.AD_Client_ID=ev.AD_Client_ID) ")
|
||||
.append("WHERE Account_ID IS NULL AND AccountValue IS NOT NULL")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Account from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Account, '"
|
||||
+ "WHERE (Account_ID IS NULL OR Account_ID=0)"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Account, '")
|
||||
.append("WHERE (Account_ID IS NULL OR Account_ID=0)")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Account=" + no);
|
||||
|
||||
// Set BPartner
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_BPartner_ID=(SELECT bp.C_BPartner_ID FROM C_BPartner bp"
|
||||
+ " WHERE bp.Value=i.BPartnerValue AND bp.IsSummary='N' AND i.AD_Client_ID=bp.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_BPartner_ID=(SELECT bp.C_BPartner_ID FROM C_BPartner bp")
|
||||
.append(" WHERE bp.Value=i.BPartnerValue AND bp.IsSummary='N' AND i.AD_Client_ID=bp.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BPartner from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner, '"
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner, '")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid BPartner=" + no);
|
||||
|
||||
// Set Product
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET M_Product_ID=(SELECT MAX(p.M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE (p.Value=i.ProductValue OR p.UPC=i.UPC OR p.SKU=i.SKU)"
|
||||
+ " AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(p.M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE (p.Value=i.ProductValue OR p.UPC=i.UPC OR p.SKU=i.SKU)")
|
||||
.append(" AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Product from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, '"
|
||||
+ "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, '")
|
||||
.append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Product=" + no);
|
||||
|
||||
// Set Project
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET C_Project_ID=(SELECT p.C_Project_ID FROM C_Project p"
|
||||
+ " WHERE p.Value=i.ProjectValue AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET C_Project_ID=(SELECT p.C_Project_ID FROM C_Project p")
|
||||
.append(" WHERE p.Value=i.ProjectValue AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Project from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, '"
|
||||
+ "WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, '")
|
||||
.append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Project=" + no);
|
||||
|
||||
// Set TrxOrg
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET AD_OrgTrx_ID=(SELECT o.AD_Org_ID FROM AD_Org o"
|
||||
+ " WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID) "
|
||||
+ "WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET AD_OrgTrx_ID=(SELECT o.AD_Org_ID FROM AD_Org o")
|
||||
.append(" WHERE o.Value=i.OrgValue AND o.IsSummary='N' AND i.AD_Client_ID=o.AD_Client_ID) ")
|
||||
.append("WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set OrgTrx from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid OrgTrx, '"
|
||||
+ "WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL"
|
||||
+ " AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid OrgTrx, '")
|
||||
.append("WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL")
|
||||
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid OrgTrx=" + no);
|
||||
|
||||
|
||||
// Source Amounts
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal "
|
||||
+ "SET AmtSourceDr = 0 "
|
||||
+ "WHERE AmtSourceDr IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal ")
|
||||
.append("SET AmtSourceDr = 0 ")
|
||||
.append("WHERE AmtSourceDr IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set 0 Source Dr=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal "
|
||||
+ "SET AmtSourceCr = 0 "
|
||||
+ "WHERE AmtSourceCr IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal ")
|
||||
.append("SET AmtSourceCr = 0 ")
|
||||
.append("WHERE AmtSourceCr IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set 0 Source Cr=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Source Balance, ' "
|
||||
+ "WHERE (AmtSourceDr-AmtSourceCr)=0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Source Balance, ' ")
|
||||
.append("WHERE (AmtSourceDr-AmtSourceCr)=0")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Zero Source Balance=" + no);
|
||||
|
||||
// Accounted Amounts (Only if No Error)
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal "
|
||||
+ "SET AmtAcctDr = ROUND(AmtSourceDr * CurrencyRate, 2) " // HARDCODED rounding
|
||||
+ "WHERE AmtAcctDr IS NULL OR AmtAcctDr=0"
|
||||
+ " AND I_IsImported='N'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal ")
|
||||
.append("SET AmtAcctDr = ROUND(AmtSourceDr * CurrencyRate, 2) ") // HARDCODED rounding
|
||||
.append("WHERE AmtAcctDr IS NULL OR AmtAcctDr=0")
|
||||
.append(" AND I_IsImported='N'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Calculate Acct Dr=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal "
|
||||
+ "SET AmtAcctCr = ROUND(AmtSourceCr * CurrencyRate, 2) "
|
||||
+ "WHERE AmtAcctCr IS NULL OR AmtAcctCr=0"
|
||||
+ " AND I_IsImported='N'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal ")
|
||||
.append("SET AmtAcctCr = ROUND(AmtSourceCr * CurrencyRate, 2) ")
|
||||
.append("WHERE AmtAcctCr IS NULL OR AmtAcctCr=0")
|
||||
.append(" AND I_IsImported='N'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Calculate Acct Cr=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal i "
|
||||
+ "SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Acct Balance, ' "
|
||||
+ "WHERE (AmtSourceDr-AmtSourceCr)<>0 AND (AmtAcctDr-AmtAcctCr)=0"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal i ")
|
||||
.append("SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Acct Balance, ' ")
|
||||
.append("WHERE (AmtSourceDr-AmtSourceCr)<>0 AND (AmtAcctDr-AmtAcctCr)=0")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Zero Acct Balance=" + no);
|
||||
|
@ -533,9 +534,9 @@ public class ImportGLJournal extends SvrProcess
|
|||
/*********************************************************************/
|
||||
|
||||
// Get Balance
|
||||
sql = new StringBuffer ("SELECT SUM(AmtSourceDr)-SUM(AmtSourceCr), SUM(AmtAcctDr)-SUM(AmtAcctCr) "
|
||||
+ "FROM I_GLJournal "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck);
|
||||
sql = new StringBuilder ("SELECT SUM(AmtSourceDr)-SUM(AmtSourceCr), SUM(AmtAcctDr)-SUM(AmtAcctCr) ")
|
||||
.append("FROM I_GLJournal ")
|
||||
.append("WHERE I_IsImported='N'").append (clientCheck);
|
||||
PreparedStatement pstmt = null;
|
||||
try
|
||||
{
|
||||
|
@ -548,8 +549,10 @@ public class ImportGLJournal extends SvrProcess
|
|||
if (source != null && source.signum() == 0
|
||||
&& acct != null && acct.signum() == 0)
|
||||
log.info ("Import Balance = 0");
|
||||
else
|
||||
log.warning("Balance Source=" + source + ", Acct=" + acct);
|
||||
else{
|
||||
msglog = new StringBuilder("Balance Source=").append(source).append(", Acct=").append(acct);
|
||||
log.warning(msglog.toString());
|
||||
}
|
||||
if (source != null)
|
||||
addLog (0, null, source, "@AmtSourceDr@ - @AmtSourceCr@");
|
||||
if (acct != null)
|
||||
|
@ -585,10 +588,12 @@ public class ImportGLJournal extends SvrProcess
|
|||
if (m_IsValidateOnly || m_IsImportOnlyNoErrors)
|
||||
throw new Exception ("@Errors@=" + errors);
|
||||
}
|
||||
else if (m_IsValidateOnly)
|
||||
return "@Errors@=" + errors;
|
||||
|
||||
log.info("Validation Errors=" + errors);
|
||||
else if (m_IsValidateOnly){
|
||||
StringBuilder msgreturn = new StringBuilder("@Errors@=").append(errors);
|
||||
return msgreturn.toString();
|
||||
}
|
||||
msglog = new StringBuilder("Validation Errors=").append(errors);
|
||||
log.info(msglog.toString());
|
||||
// moved commit above to save error messages
|
||||
// commit();
|
||||
|
||||
|
@ -606,11 +611,11 @@ public class ImportGLJournal extends SvrProcess
|
|||
boolean wasCreateNewBatch = false;
|
||||
|
||||
// Go through Journal Records
|
||||
sql = new StringBuffer ("SELECT * FROM I_GLJournal "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck)
|
||||
.append(" ORDER BY COALESCE(BatchDocumentNo, TO_NCHAR(I_GLJournal_ID)||' '), COALESCE(JournalDocumentNo, " +
|
||||
"TO_NCHAR(I_GLJournal_ID)||' '), C_AcctSchema_ID, PostingType, C_DocType_ID, GL_Category_ID, " +
|
||||
"C_Currency_ID, TRUNC(DateAcct), Line, I_GLJournal_ID");
|
||||
sql = new StringBuilder ("SELECT * FROM I_GLJournal ")
|
||||
.append("WHERE I_IsImported='N'").append (clientCheck)
|
||||
.append(" ORDER BY COALESCE(BatchDocumentNo, TO_NCHAR(I_GLJournal_ID)||' '), COALESCE(JournalDocumentNo, ")
|
||||
.append("TO_NCHAR(I_GLJournal_ID)||' '), C_AcctSchema_ID, PostingType, C_DocType_ID, GL_Category_ID, ")
|
||||
.append("C_Currency_ID, TRUNC(DateAcct), Line, I_GLJournal_ID");
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql.toString (), get_TrxName());
|
||||
|
@ -647,13 +652,13 @@ public class ImportGLJournal extends SvrProcess
|
|||
batch.setDocumentNo (imp.getBatchDocumentNo());
|
||||
batch.setC_DocType_ID(imp.getC_DocType_ID());
|
||||
batch.setPostingType(imp.getPostingType());
|
||||
String description = imp.getBatchDescription();
|
||||
StringBuilder description = new StringBuilder(imp.getBatchDescription());
|
||||
if (description == null || description.length() == 0)
|
||||
description = "*Import-";
|
||||
description = new StringBuilder("*Import-");
|
||||
else
|
||||
description += " *Import-";
|
||||
description += new Timestamp(System.currentTimeMillis());
|
||||
batch.setDescription(description);
|
||||
description.append(" *Import-");
|
||||
description.append(new Timestamp(System.currentTimeMillis()));
|
||||
batch.setDescription(description.toString());
|
||||
if (!batch.save())
|
||||
{
|
||||
log.log(Level.SEVERE, "Batch not saved");
|
||||
|
@ -795,9 +800,9 @@ public class ImportGLJournal extends SvrProcess
|
|||
pstmt = null;
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_GLJournal "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_GLJournal ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
//
|
||||
|
|
|
@ -68,67 +68,68 @@ public class ImportInOutConfirm extends SvrProcess
|
|||
*/
|
||||
protected String doIt () throws Exception
|
||||
{
|
||||
log.info("I_InOutLineConfirm_ID=" + p_I_InOutLineConfirm_ID);
|
||||
StringBuffer sql = null;
|
||||
StringBuilder msglog = new StringBuilder("I_InOutLineConfirm_ID=").append(p_I_InOutLineConfirm_ID);
|
||||
log.info(msglog.toString());
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + p_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(p_AD_Client_ID);
|
||||
|
||||
// Delete Old Imported
|
||||
if (p_DeleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_InOutLineConfirm "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_InOutLineConfirm ")
|
||||
.append("WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_InOutLineConfirm "
|
||||
+ "SET IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder ("UPDATE I_InOutLineConfirm ")
|
||||
.append("SET IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info ("Reset=" + no);
|
||||
|
||||
// Set Client from Name
|
||||
sql = new StringBuffer ("UPDATE I_InOutLineConfirm i "
|
||||
+ "SET AD_Client_ID=COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append (") "
|
||||
+ "WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0)"
|
||||
+ " AND I_IsImported<>'Y'");
|
||||
sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ")
|
||||
.append("SET AD_Client_ID=COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append (") ")
|
||||
.append("WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0)")
|
||||
.append(" AND I_IsImported<>'Y'");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Client from Value=" + no);
|
||||
|
||||
// Error Confirmation Line
|
||||
sql = new StringBuffer ("UPDATE I_InOutLineConfirm i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Confirmation Line, '"
|
||||
+ "WHERE (M_InOutLineConfirm_ID IS NULL OR M_InOutLineConfirm_ID=0"
|
||||
+ " OR NOT EXISTS (SELECT * FROM M_InOutLineConfirm c WHERE i.M_InOutLineConfirm_ID=c.M_InOutLineConfirm_ID))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Confirmation Line, '")
|
||||
.append("WHERE (M_InOutLineConfirm_ID IS NULL OR M_InOutLineConfirm_ID=0")
|
||||
.append(" OR NOT EXISTS (SELECT * FROM M_InOutLineConfirm c WHERE i.M_InOutLineConfirm_ID=c.M_InOutLineConfirm_ID))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid InOutLineConfirm=" + no);
|
||||
|
||||
// Error Confirmation No
|
||||
sql = new StringBuffer ("UPDATE I_InOutLineConfirm i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Missing Confirmation No, '"
|
||||
+ "WHERE (ConfirmationNo IS NULL OR ConfirmationNo='')"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Missing Confirmation No, '")
|
||||
.append("WHERE (ConfirmationNo IS NULL OR ConfirmationNo='')")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid ConfirmationNo=" + no);
|
||||
|
||||
// Qty
|
||||
sql = new StringBuffer ("UPDATE I_InOutLineConfirm i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Target<>(Confirmed+Difference+Scrapped), ' "
|
||||
+ "WHERE EXISTS (SELECT * FROM M_InOutLineConfirm c "
|
||||
+ "WHERE i.M_InOutLineConfirm_ID=c.M_InOutLineConfirm_ID"
|
||||
+ " AND c.TargetQty<>(i.ConfirmedQty+i.ScrappedQty+i.DifferenceQty))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Target<>(Confirmed+Difference+Scrapped), ' ")
|
||||
.append("WHERE EXISTS (SELECT * FROM M_InOutLineConfirm c ")
|
||||
.append("WHERE i.M_InOutLineConfirm_ID=c.M_InOutLineConfirm_ID")
|
||||
.append(" AND c.TargetQty<>(i.ConfirmedQty+i.ScrappedQty+i.DifferenceQty))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Qty=" + no);
|
||||
|
@ -138,8 +139,8 @@ public class ImportInOutConfirm extends SvrProcess
|
|||
/*********************************************************************/
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
sql = new StringBuffer ("SELECT * FROM I_InOutLineConfirm "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck)
|
||||
sql = new StringBuilder ("SELECT * FROM I_InOutLineConfirm ")
|
||||
.append("WHERE I_IsImported='N'").append (clientCheck)
|
||||
.append(" ORDER BY I_InOutLineConfirm_ID");
|
||||
no = 0;
|
||||
try
|
||||
|
@ -193,8 +194,8 @@ public class ImportInOutConfirm extends SvrProcess
|
|||
{
|
||||
pstmt = null;
|
||||
}
|
||||
|
||||
return "@Updated@ #" + no;
|
||||
StringBuilder msgreturn = new StringBuilder("@Updated@ #").append(no);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
} // ImportInOutConfirm
|
||||
|
|
|
@ -112,7 +112,8 @@ public class ImportInventory extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
log.info("M_Locator_ID=" + p_M_Locator_ID + ",MovementDate=" + p_MovementDate);
|
||||
StringBuilder msglog = new StringBuilder("M_Locator_ID=").append(p_M_Locator_ID).append(",MovementDate=").append(p_MovementDate);
|
||||
log.info(msglog.toString());
|
||||
|
||||
if (p_UpdateCosting) {
|
||||
if (p_C_AcctSchema_ID <= 0) {
|
||||
|
@ -130,174 +131,174 @@ public class ImportInventory extends SvrProcess
|
|||
acctSchema = MAcctSchema.get(getCtx(), p_C_AcctSchema_ID, get_TrxName());
|
||||
}
|
||||
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + p_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(p_AD_Client_ID);
|
||||
|
||||
// **** Prepare ****
|
||||
|
||||
// Delete Old Imported
|
||||
if (p_DeleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_Inventory "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_Inventory ")
|
||||
.append("WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
log.fine("Delete Old Imported=" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, Location, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),"
|
||||
+ " AD_Org_ID = DECODE (NVL(AD_Org_ID),0,").append (p_AD_Org_ID).append (",AD_Org_ID),");
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (p_AD_Client_ID).append ("),")
|
||||
.append(" AD_Org_ID = DECODE (NVL(AD_Org_ID),0,").append (p_AD_Org_ID).append (",AD_Org_ID),");
|
||||
if (p_MovementDate != null)
|
||||
sql.append(" MovementDate = COALESCE (MovementDate,").append (DB.TO_DATE(p_MovementDate)).append ("),");
|
||||
sql.append(" IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " M_Warehouse_ID = NULL," // reset
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" M_Warehouse_ID = NULL,") // reset
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
log.info ("Reset=" + no);
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Inventory o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '"
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '")
|
||||
.append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0")
|
||||
.append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Org=" + no);
|
||||
|
||||
// Document Type
|
||||
sql = new StringBuffer ("UPDATE I_Inventory i "
|
||||
+ "SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d"
|
||||
+ " WHERE d.Name=i.DocTypeName AND d.DocBaseType='MMI' AND i.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory i ")
|
||||
.append("SET C_DocType_ID=(SELECT d.C_DocType_ID FROM C_DocType d")
|
||||
.append(" WHERE d.Name=i.DocTypeName AND d.DocBaseType='MMI' AND i.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Inventory i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, ' "
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, ' ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid DocType=" + no);
|
||||
|
||||
// Locator
|
||||
sql = new StringBuffer ("UPDATE I_Inventory i "
|
||||
+ "SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l"
|
||||
+ " WHERE i.LocatorValue=l.Value AND i.AD_Client_ID=l.AD_Client_ID) "
|
||||
+ "WHERE M_Locator_ID IS NULL AND LocatorValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory i ")
|
||||
.append("SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l")
|
||||
.append(" WHERE i.LocatorValue=l.Value AND i.AD_Client_ID=l.AD_Client_ID) ")
|
||||
.append("WHERE M_Locator_ID IS NULL AND LocatorValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
log.fine("Set Locator from Value =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Inventory i "
|
||||
+ "SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l"
|
||||
+ " WHERE i.X=l.X AND i.Y=l.Y AND i.Z=l.Z AND i.AD_Client_ID=l.AD_Client_ID) "
|
||||
+ "WHERE M_Locator_ID IS NULL AND X IS NOT NULL AND Y IS NOT NULL AND Z IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory i ")
|
||||
.append("SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l")
|
||||
.append(" WHERE i.X=l.X AND i.Y=l.Y AND i.Z=l.Z AND i.AD_Client_ID=l.AD_Client_ID) ")
|
||||
.append("WHERE M_Locator_ID IS NULL AND X IS NOT NULL AND Y IS NOT NULL AND Z IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
log.fine("Set Locator from X,Y,Z =" + no);
|
||||
if (p_M_Locator_ID != 0)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET M_Locator_ID = ").append (p_M_Locator_ID).append (
|
||||
" WHERE M_Locator_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET M_Locator_ID = ").append (p_M_Locator_ID)
|
||||
.append (" WHERE M_Locator_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
log.fine("Set Locator from Parameter=" + no);
|
||||
}
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Location, ' "
|
||||
+ "WHERE M_Locator_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Location, ' ")
|
||||
.append("WHERE M_Locator_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No Location=" + no);
|
||||
|
||||
|
||||
// Set M_Warehouse_ID
|
||||
sql = new StringBuffer ("UPDATE I_Inventory i "
|
||||
+ "SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Locator l WHERE i.M_Locator_ID=l.M_Locator_ID) "
|
||||
+ "WHERE M_Locator_ID IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory i ")
|
||||
.append("SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Locator l WHERE i.M_Locator_ID=l.M_Locator_ID) ")
|
||||
.append("WHERE M_Locator_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
log.fine("Set Warehouse from Locator =" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' "
|
||||
+ "WHERE M_Warehouse_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' ")
|
||||
.append("WHERE M_Warehouse_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No Warehouse=" + no);
|
||||
|
||||
|
||||
// Product
|
||||
sql = new StringBuffer ("UPDATE I_Inventory i "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND Value IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory i ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND Value IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
log.fine("Set Product from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Inventory i "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND UPC IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory i ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
log.fine("Set Product from UPC=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Product, ' "
|
||||
+ "WHERE M_Product_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Product, ' ")
|
||||
.append("WHERE M_Product_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No Product=" + no);
|
||||
|
||||
// Charge
|
||||
sql = new StringBuffer ("UPDATE I_Inventory o "
|
||||
+ "SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge p"
|
||||
+ " WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory o ")
|
||||
.append("SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge p")
|
||||
.append(" WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Charge=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' "
|
||||
+ "WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ")
|
||||
.append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Charge=" + no);
|
||||
|
||||
// No QtyCount or QtyInternalUse
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Qty Count or Internal Use, ' "
|
||||
+ "WHERE QtyCount IS NULL AND QtyInternalUse IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Qty Count or Internal Use, ' ")
|
||||
.append("WHERE QtyCount IS NULL AND QtyInternalUse IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No QtyCount or QtyInternalUse=" + no);
|
||||
|
||||
// Excluding quantities
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Excluding quantities, ' "
|
||||
+ "WHERE NVL(QtyInternalUse,0)<>0 AND (NVL(QtyCount,0)<>0 OR NVL(QtyBook,0)<>0) "
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Excluding quantities, ' ")
|
||||
.append("WHERE NVL(QtyInternalUse,0)<>0 AND (NVL(QtyCount,0)<>0 OR NVL(QtyBook,0)<>0) ")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Excluding quantities=" + no);
|
||||
|
||||
// Required charge for internal use
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Required charge, ' "
|
||||
+ "WHERE NVL(QtyInternalUse,0)<>0 AND NVL(C_Charge_ID,0)=0 "
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Required charge, ' ")
|
||||
.append("WHERE NVL(QtyInternalUse,0)<>0 AND NVL(C_Charge_ID,0)=0 ")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate (sql.toString (), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Required charge=" + no);
|
||||
|
@ -312,8 +313,8 @@ public class ImportInventory extends SvrProcess
|
|||
int noInsertLine = 0;
|
||||
|
||||
// Go through Inventory Records
|
||||
sql = new StringBuffer ("SELECT * FROM I_Inventory "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck)
|
||||
sql = new StringBuilder ("SELECT * FROM I_Inventory ")
|
||||
.append("WHERE I_IsImported='N'").append (clientCheck)
|
||||
.append(" ORDER BY M_Warehouse_ID, TRUNC(MovementDate), I_Inventory_ID");
|
||||
try
|
||||
{
|
||||
|
@ -415,9 +416,9 @@ public class ImportInventory extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_Inventory "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Inventory ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
//
|
||||
|
|
|
@ -86,282 +86,282 @@ public class ImportInvoice extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID);
|
||||
|
||||
// **** Prepare ****
|
||||
|
||||
// Delete Old Imported
|
||||
if (m_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_Invoice "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_Invoice ")
|
||||
.append("WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),")
|
||||
.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info ("Reset=" + no);
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '"
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '")
|
||||
.append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0")
|
||||
.append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Org=" + no);
|
||||
|
||||
// Document Type - PO - SO
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName"
|
||||
+ " AND d.DocBaseType IN ('API','APC') AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName")
|
||||
.append(" AND d.DocBaseType IN ('API','APC') AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set PO DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName"
|
||||
+ " AND d.DocBaseType IN ('ARI','ARC') AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName")
|
||||
.append(" AND d.DocBaseType IN ('ARI','ARC') AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set SO DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName"
|
||||
+ " AND d.DocBaseType IN ('API','ARI','APC','ARC') AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName")
|
||||
.append(" AND d.DocBaseType IN ('API','ARI','APC','ARC') AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
//+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' "
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid DocTypeName=" + no);
|
||||
// DocType Default
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'"
|
||||
+ " AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'")
|
||||
.append(" AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set PO Default DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'"
|
||||
+ " AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'")
|
||||
.append(" AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set SO Default DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'"
|
||||
+ " AND d.DocBaseType IN('ARI','API') AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'")
|
||||
.append(" AND d.DocBaseType IN('ARI','API') AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set Default DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' "
|
||||
+ "WHERE C_DocType_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' ")
|
||||
.append("WHERE C_DocType_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No DocType=" + no);
|
||||
|
||||
// Set IsSOTrx
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o SET IsSOTrx='Y' "
|
||||
+ "WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID)"
|
||||
+ " AND C_DocType_ID IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o SET IsSOTrx='Y' ")
|
||||
.append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID)")
|
||||
.append(" AND C_DocType_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set IsSOTrx=Y=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o SET IsSOTrx='N' "
|
||||
+ "WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID)"
|
||||
+ " AND C_DocType_ID IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o SET IsSOTrx='N' ")
|
||||
.append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID)")
|
||||
.append(" AND C_DocType_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set IsSOTrx=N=" + no);
|
||||
|
||||
// Price List
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'"
|
||||
+ " AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'")
|
||||
.append(" AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default Currency PriceList=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'"
|
||||
+ " AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'")
|
||||
.append(" AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default PriceList=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p "
|
||||
+ " WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ")
|
||||
.append(" WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Currency PriceList=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p "
|
||||
+ " WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ")
|
||||
.append(" WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PriceList=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' "
|
||||
+ "WHERE M_PriceList_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' ")
|
||||
.append("WHERE M_PriceList_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No PriceList=" + no);
|
||||
|
||||
// Payment Term
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_PaymentTerm_ID=(SELECT C_PaymentTerm_ID FROM C_PaymentTerm p"
|
||||
+ " WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_PaymentTerm_ID=(SELECT C_PaymentTerm_ID FROM C_PaymentTerm p")
|
||||
.append(" WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PaymentTerm=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p"
|
||||
+ " WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p")
|
||||
.append(" WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default PaymentTerm=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' "
|
||||
+ "WHERE C_PaymentTerm_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' ")
|
||||
.append("WHERE C_PaymentTerm_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No PaymentTerm=" + no);
|
||||
|
||||
// globalqss - Add project and activity
|
||||
// Project
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_Project_ID=(SELECT C_Project_ID FROM C_Project p"
|
||||
+ " WHERE o.ProjectValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_Project_ID=(SELECT C_Project_ID FROM C_Project p")
|
||||
.append(" WHERE o.ProjectValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Project=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, ' "
|
||||
+ "WHERE C_Project_ID IS NULL AND (ProjectValue IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, ' ")
|
||||
.append("WHERE C_Project_ID IS NULL AND (ProjectValue IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Project=" + no);
|
||||
// Activity
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_Activity_ID=(SELECT C_Activity_ID FROM C_Activity p"
|
||||
+ " WHERE o.ActivityValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_Activity_ID=(SELECT C_Activity_ID FROM C_Activity p")
|
||||
.append(" WHERE o.ActivityValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Activity=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Activity, ' "
|
||||
+ "WHERE C_Activity_ID IS NULL AND (ActivityValue IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Activity, ' ")
|
||||
.append("WHERE C_Activity_ID IS NULL AND (ActivityValue IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Activity=" + no);
|
||||
// globalqss - add charge
|
||||
// Charge
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge p"
|
||||
+ " WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge p")
|
||||
.append(" WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Charge=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' "
|
||||
+ "WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ")
|
||||
.append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Charge=" + no);
|
||||
//
|
||||
|
||||
// BP from EMail
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u"
|
||||
+ " WHERE o.EMail=u.EMail AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u")
|
||||
.append(" WHERE o.EMail=u.EMail AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP from EMail=" + no);
|
||||
// BP from ContactName
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u"
|
||||
+ " WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND ContactName IS NOT NULL"
|
||||
+ " AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u")
|
||||
.append(" WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND ContactName IS NOT NULL")
|
||||
.append(" AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP from ContactName=" + no);
|
||||
// BP from Value
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp"
|
||||
+ " WHERE o.BPartnerValue=bp.Value AND o.AD_Client_ID=bp.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp")
|
||||
.append(" WHERE o.BPartnerValue=bp.Value AND o.AD_Client_ID=bp.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP from Value=" + no);
|
||||
// Default BP
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c"
|
||||
+ " WHERE o.AD_Client_ID=c.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c")
|
||||
.append(" WHERE o.AD_Client_ID=c.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default BP=" + no);
|
||||
|
||||
// Existing Location ? Exact Match
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID"
|
||||
+ " FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)"
|
||||
+ " WHERE o.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=o.AD_Client_ID"
|
||||
+ " AND DUMP(o.Address1)=DUMP(l.Address1) AND DUMP(o.Address2)=DUMP(l.Address2)"
|
||||
+ " AND DUMP(o.City)=DUMP(l.City) AND DUMP(o.Postal)=DUMP(l.Postal)"
|
||||
+ " AND o.C_Region_ID=l.C_Region_ID AND o.C_Country_ID=l.C_Country_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID")
|
||||
.append(" FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)")
|
||||
.append(" WHERE o.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=o.AD_Client_ID")
|
||||
.append(" AND DUMP(o.Address1)=DUMP(l.Address1) AND DUMP(o.Address2)=DUMP(l.Address2)")
|
||||
.append(" AND DUMP(o.City)=DUMP(l.City) AND DUMP(o.Postal)=DUMP(l.Postal)")
|
||||
.append(" AND o.C_Region_ID=l.C_Region_ID AND o.C_Country_ID=l.C_Country_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Found Location=" + no);
|
||||
// Set Location from BPartner
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l"
|
||||
+ " WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID"
|
||||
+ " AND ((l.IsBillTo='Y' AND o.IsSOTrx='Y') OR o.IsSOTrx='N')"
|
||||
+ ") "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l")
|
||||
.append(" WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID")
|
||||
.append(" AND ((l.IsBillTo='Y' AND o.IsSOTrx='Y') OR o.IsSOTrx='N')")
|
||||
.append(") ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP Location from BP=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No BP Location=" + no);
|
||||
|
@ -376,102 +376,102 @@ public class ImportInvoice extends SvrProcess
|
|||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Country Default=" + no);
|
||||
**/
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c"
|
||||
+ " WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c")
|
||||
.append(" WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Country=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Country=" + no);
|
||||
|
||||
// Set Region
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "Set RegionName=(SELECT MAX(Name) FROM C_Region r"
|
||||
+ " WHERE r.IsDefault='Y' AND r.C_Country_ID=o.C_Country_ID"
|
||||
+ " AND r.AD_Client_ID IN (0, o.AD_Client_ID)) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("Set RegionName=(SELECT MAX(Name) FROM C_Region r")
|
||||
.append(" WHERE r.IsDefault='Y' AND r.C_Country_ID=o.C_Country_ID")
|
||||
.append(" AND r.AD_Client_ID IN (0, o.AD_Client_ID)) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Region Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r"
|
||||
+ " WHERE r.Name=o.RegionName AND r.C_Country_ID=o.C_Country_ID"
|
||||
+ " AND r.AD_Client_ID IN (0, o.AD_Client_ID)) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r")
|
||||
.append(" WHERE r.Name=o.RegionName AND r.C_Country_ID=o.C_Country_ID")
|
||||
.append(" AND r.AD_Client_ID IN (0, o.AD_Client_ID)) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Region=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL "
|
||||
+ " AND EXISTS (SELECT * FROM C_Country c"
|
||||
+ " WHERE c.C_Country_ID=o.C_Country_ID AND c.HasRegion='Y')"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL ")
|
||||
.append(" AND EXISTS (SELECT * FROM C_Country c")
|
||||
.append(" WHERE c.C_Country_ID=o.C_Country_ID AND c.HasRegion='Y')")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Region=" + no);
|
||||
|
||||
// Product
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE o.ProductValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE o.ProductValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Product from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND UPC IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Product from UPC=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND SKU IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND SKU IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Product fom SKU=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' "
|
||||
+ "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' ")
|
||||
.append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Product=" + no);
|
||||
|
||||
// globalqss - charge and product are exclusive
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Product and Charge, ' "
|
||||
+ "WHERE M_Product_ID IS NOT NULL AND C_Charge_ID IS NOT NULL "
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Product and Charge, ' ")
|
||||
.append("WHERE M_Product_ID IS NOT NULL AND C_Charge_ID IS NOT NULL ")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Product and Charge exclusive=" + no);
|
||||
|
||||
// Tax
|
||||
sql = new StringBuffer ("UPDATE I_Invoice o "
|
||||
+ "SET C_Tax_ID=(SELECT MAX(C_Tax_ID) FROM C_Tax t"
|
||||
+ " WHERE o.TaxIndicator=t.TaxIndicator AND o.AD_Client_ID=t.AD_Client_ID) "
|
||||
+ "WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice o ")
|
||||
.append("SET C_Tax_ID=(SELECT MAX(C_Tax_ID) FROM C_Tax t")
|
||||
.append(" WHERE o.TaxIndicator=t.TaxIndicator AND o.AD_Client_ID=t.AD_Client_ID) ")
|
||||
.append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Tax=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' "
|
||||
+ "WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' ")
|
||||
.append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Tax=" + no);
|
||||
|
@ -481,8 +481,8 @@ public class ImportInvoice extends SvrProcess
|
|||
// -- New BPartner ---------------------------------------------------
|
||||
|
||||
// Go through Invoice Records w/o C_BPartner_ID
|
||||
sql = new StringBuffer ("SELECT * FROM I_Invoice "
|
||||
+ "WHERE I_IsImported='N' AND C_BPartner_ID IS NULL").append (clientCheck);
|
||||
sql = new StringBuilder ("SELECT * FROM I_Invoice ")
|
||||
.append("WHERE I_IsImported='N' AND C_BPartner_ID IS NULL").append (clientCheck);
|
||||
try
|
||||
{
|
||||
PreparedStatement pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
|
@ -601,10 +601,10 @@ public class ImportInvoice extends SvrProcess
|
|||
{
|
||||
log.log(Level.SEVERE, "CreateBP", e);
|
||||
}
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' "
|
||||
+ "WHERE C_BPartner_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No BPartner=" + no);
|
||||
|
@ -617,8 +617,8 @@ public class ImportInvoice extends SvrProcess
|
|||
int noInsertLine = 0;
|
||||
|
||||
// Go through Invoice Records w/o
|
||||
sql = new StringBuffer ("SELECT * FROM I_Invoice "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck)
|
||||
sql = new StringBuilder ("SELECT * FROM I_Invoice ")
|
||||
.append("WHERE I_IsImported='N'").append (clientCheck)
|
||||
.append(" ORDER BY C_BPartner_ID, C_BPartner_Location_ID, I_Invoice_ID");
|
||||
try
|
||||
{
|
||||
|
@ -760,9 +760,9 @@ public class ImportInvoice extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_Invoice "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Invoice ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
//
|
||||
|
|
|
@ -88,7 +88,7 @@ public class ImportOrder extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
|
||||
|
@ -97,272 +97,272 @@ public class ImportOrder extends SvrProcess
|
|||
// Delete Old Imported
|
||||
if (m_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_Order "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_Order ")
|
||||
.append("WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append ("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),")
|
||||
.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info ("Reset=" + no);
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '"
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '")
|
||||
.append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0")
|
||||
.append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Org=" + no);
|
||||
|
||||
// Document Type - PO - SO
|
||||
sql = new StringBuffer ("UPDATE I_Order o " // PO Document Type Name
|
||||
+ "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName"
|
||||
+ " AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ") // PO Document Type Name
|
||||
.append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName")
|
||||
.append(" AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PO DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o " // SO Document Type Name
|
||||
+ "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName"
|
||||
+ " AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ") // SO Document Type Name
|
||||
.append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName")
|
||||
.append(" AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set SO DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName"
|
||||
+ " AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName")
|
||||
.append(" AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
//+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order " // Error Invalid Doc Type Name
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' "
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ") // Error Invalid Doc Type Name
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid DocTypeName=" + no);
|
||||
// DocType Default
|
||||
sql = new StringBuffer ("UPDATE I_Order o " // Default PO
|
||||
+ "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'"
|
||||
+ " AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ") // Default PO
|
||||
.append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'")
|
||||
.append(" AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PO Default DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o " // Default SO
|
||||
+ "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'"
|
||||
+ " AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ") // Default SO
|
||||
.append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'")
|
||||
.append(" AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set SO Default DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'"
|
||||
+ " AND d.DocBaseType IN('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'")
|
||||
.append(" AND d.DocBaseType IN('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order " // No DocType
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' "
|
||||
+ "WHERE C_DocType_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ") // No DocType
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' ")
|
||||
.append("WHERE C_DocType_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No DocType=" + no);
|
||||
|
||||
// Set IsSOTrx
|
||||
sql = new StringBuffer ("UPDATE I_Order o SET IsSOTrx='Y' "
|
||||
+ "WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID)"
|
||||
+ " AND C_DocType_ID IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o SET IsSOTrx='Y' ")
|
||||
.append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID)")
|
||||
.append(" AND C_DocType_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set IsSOTrx=Y=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o SET IsSOTrx='N' "
|
||||
+ "WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID)"
|
||||
+ " AND C_DocType_ID IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o SET IsSOTrx='N' ")
|
||||
.append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID)")
|
||||
.append(" AND C_DocType_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set IsSOTrx=N=" + no);
|
||||
|
||||
// Price List
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'"
|
||||
+ " AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'")
|
||||
.append(" AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default Currency PriceList=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'"
|
||||
+ " AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'")
|
||||
.append(" AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default PriceList=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p "
|
||||
+ " WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ")
|
||||
.append(" WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Currency PriceList=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p "
|
||||
+ " WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ")
|
||||
.append(" WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PriceList=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' "
|
||||
+ "WHERE M_PriceList_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' ")
|
||||
.append("WHERE M_PriceList_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No PriceList=" + no);
|
||||
|
||||
// @Trifon - Import Order Source
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_OrderSource_ID=(SELECT C_OrderSource_ID FROM C_OrderSource p"
|
||||
+ " WHERE o.C_OrderSourceValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_OrderSource_ID=(SELECT C_OrderSource_ID FROM C_OrderSource p")
|
||||
.append(" WHERE o.C_OrderSourceValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Order Source=" + no);
|
||||
// Set proper error message
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Not Found Order Source, ' "
|
||||
+ "WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Not Found Order Source, ' ")
|
||||
.append("WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No OrderSource=" + no);
|
||||
|
||||
// Payment Term
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_PaymentTerm_ID=(SELECT C_PaymentTerm_ID FROM C_PaymentTerm p"
|
||||
+ " WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_PaymentTerm_ID=(SELECT C_PaymentTerm_ID FROM C_PaymentTerm p")
|
||||
.append(" WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PaymentTerm=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p"
|
||||
+ " WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p")
|
||||
.append(" WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default PaymentTerm=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' "
|
||||
+ "WHERE C_PaymentTerm_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' ")
|
||||
.append("WHERE C_PaymentTerm_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No PaymentTerm=" + no);
|
||||
|
||||
// Warehouse
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_Warehouse_ID=(SELECT MAX(M_Warehouse_ID) FROM M_Warehouse w"
|
||||
+ " WHERE o.AD_Client_ID=w.AD_Client_ID AND o.AD_Org_ID=w.AD_Org_ID) "
|
||||
+ "WHERE M_Warehouse_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_Warehouse_ID=(SELECT MAX(M_Warehouse_ID) FROM M_Warehouse w")
|
||||
.append(" WHERE o.AD_Client_ID=w.AD_Client_ID AND o.AD_Org_ID=w.AD_Org_ID) ")
|
||||
.append("WHERE M_Warehouse_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName()); // Warehouse for Org
|
||||
if (no != 0)
|
||||
log.fine("Set Warehouse=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Warehouse w"
|
||||
+ " WHERE o.AD_Client_ID=w.AD_Client_ID) "
|
||||
+ "WHERE M_Warehouse_ID IS NULL"
|
||||
+ " AND EXISTS (SELECT AD_Client_ID FROM M_Warehouse w WHERE w.AD_Client_ID=o.AD_Client_ID GROUP BY AD_Client_ID HAVING COUNT(*)=1)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Warehouse w")
|
||||
.append(" WHERE o.AD_Client_ID=w.AD_Client_ID) ")
|
||||
.append("WHERE M_Warehouse_ID IS NULL")
|
||||
.append(" AND EXISTS (SELECT AD_Client_ID FROM M_Warehouse w WHERE w.AD_Client_ID=o.AD_Client_ID GROUP BY AD_Client_ID HAVING COUNT(*)=1)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set Only Client Warehouse=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' "
|
||||
+ "WHERE M_Warehouse_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' ")
|
||||
.append("WHERE M_Warehouse_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No Warehouse=" + no);
|
||||
|
||||
// BP from EMail
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u"
|
||||
+ " WHERE o.EMail=u.EMail AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u")
|
||||
.append(" WHERE o.EMail=u.EMail AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP from EMail=" + no);
|
||||
// BP from ContactName
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u"
|
||||
+ " WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND ContactName IS NOT NULL"
|
||||
+ " AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u")
|
||||
.append(" WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND ContactName IS NOT NULL")
|
||||
.append(" AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP from ContactName=" + no);
|
||||
// BP from Value
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp"
|
||||
+ " WHERE o.BPartnerValue=bp.Value AND o.AD_Client_ID=bp.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp")
|
||||
.append(" WHERE o.BPartnerValue=bp.Value AND o.AD_Client_ID=bp.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP from Value=" + no);
|
||||
// Default BP
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c"
|
||||
+ " WHERE o.AD_Client_ID=c.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c")
|
||||
.append(" WHERE o.AD_Client_ID=c.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Default BP=" + no);
|
||||
|
||||
// Existing Location ? Exact Match
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET (BillTo_ID,C_BPartner_Location_ID)=(SELECT C_BPartner_Location_ID,C_BPartner_Location_ID"
|
||||
+ " FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)"
|
||||
+ " WHERE o.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=o.AD_Client_ID"
|
||||
+ " AND DUMP(o.Address1)=DUMP(l.Address1) AND DUMP(o.Address2)=DUMP(l.Address2)"
|
||||
+ " AND DUMP(o.City)=DUMP(l.City) AND DUMP(o.Postal)=DUMP(l.Postal)"
|
||||
+ " AND o.C_Region_ID=l.C_Region_ID AND o.C_Country_ID=l.C_Country_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET (BillTo_ID,C_BPartner_Location_ID)=(SELECT C_BPartner_Location_ID,C_BPartner_Location_ID")
|
||||
.append(" FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)")
|
||||
.append(" WHERE o.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=o.AD_Client_ID")
|
||||
.append(" AND DUMP(o.Address1)=DUMP(l.Address1) AND DUMP(o.Address2)=DUMP(l.Address2)")
|
||||
.append(" AND DUMP(o.City)=DUMP(l.City) AND DUMP(o.Postal)=DUMP(l.Postal)")
|
||||
.append(" AND o.C_Region_ID=l.C_Region_ID AND o.C_Country_ID=l.C_Country_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Found Location=" + no);
|
||||
// Set Bill Location from BPartner
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET BillTo_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l"
|
||||
+ " WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID"
|
||||
+ " AND ((l.IsBillTo='Y' AND o.IsSOTrx='Y') OR (l.IsPayFrom='Y' AND o.IsSOTrx='N'))"
|
||||
+ ") "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND BillTo_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET BillTo_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l")
|
||||
.append(" WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID")
|
||||
.append(" AND ((l.IsBillTo='Y' AND o.IsSOTrx='Y') OR (l.IsPayFrom='Y' AND o.IsSOTrx='N'))")
|
||||
.append(") ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND BillTo_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP BillTo from BP=" + no);
|
||||
// Set Location from BPartner
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l"
|
||||
+ " WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID"
|
||||
+ " AND ((l.IsShipTo='Y' AND o.IsSOTrx='Y') OR o.IsSOTrx='N')"
|
||||
+ ") "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l")
|
||||
.append(" WHERE l.C_BPartner_ID=o.C_BPartner_ID AND o.AD_Client_ID=l.AD_Client_ID")
|
||||
.append(" AND ((l.IsShipTo='Y' AND o.IsSOTrx='Y') OR o.IsSOTrx='N')")
|
||||
.append(") ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set BP Location from BP=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND (BillTo_ID IS NULL OR C_BPartner_Location_ID IS NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND (BillTo_ID IS NULL OR C_BPartner_Location_ID IS NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No BP Location=" + no);
|
||||
|
@ -377,117 +377,117 @@ public class ImportOrder extends SvrProcess
|
|||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Country Default=" + no);
|
||||
**/
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c"
|
||||
+ " WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c")
|
||||
.append(" WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Country=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Country=" + no);
|
||||
|
||||
// Set Region
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "Set RegionName=(SELECT MAX(Name) FROM C_Region r"
|
||||
+ " WHERE r.IsDefault='Y' AND r.C_Country_ID=o.C_Country_ID"
|
||||
+ " AND r.AD_Client_ID IN (0, o.AD_Client_ID)) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("Set RegionName=(SELECT MAX(Name) FROM C_Region r")
|
||||
.append(" WHERE r.IsDefault='Y' AND r.C_Country_ID=o.C_Country_ID")
|
||||
.append(" AND r.AD_Client_ID IN (0, o.AD_Client_ID)) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Region Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r"
|
||||
+ " WHERE r.Name=o.RegionName AND r.C_Country_ID=o.C_Country_ID"
|
||||
+ " AND r.AD_Client_ID IN (0, o.AD_Client_ID)) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r")
|
||||
.append(" WHERE r.Name=o.RegionName AND r.C_Country_ID=o.C_Country_ID")
|
||||
.append(" AND r.AD_Client_ID IN (0, o.AD_Client_ID)) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Region=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL "
|
||||
+ " AND EXISTS (SELECT * FROM C_Country c"
|
||||
+ " WHERE c.C_Country_ID=o.C_Country_ID AND c.HasRegion='Y')"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL ")
|
||||
.append(" AND EXISTS (SELECT * FROM C_Country c")
|
||||
.append(" WHERE c.C_Country_ID=o.C_Country_ID AND c.HasRegion='Y')")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Region=" + no);
|
||||
|
||||
// Product
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE o.ProductValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE o.ProductValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Product from Value=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND UPC IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Product from UPC=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p"
|
||||
+ " WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL AND SKU IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p")
|
||||
.append(" WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL AND SKU IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Product fom SKU=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' "
|
||||
+ "WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' ")
|
||||
.append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Product=" + no);
|
||||
|
||||
// Charge
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge c"
|
||||
+ " WHERE o.ChargeName=c.Name AND o.AD_Client_ID=c.AD_Client_ID) "
|
||||
+ "WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_Charge_ID=(SELECT C_Charge_ID FROM C_Charge c")
|
||||
.append(" WHERE o.ChargeName=c.Name AND o.AD_Client_ID=c.AD_Client_ID) ")
|
||||
.append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Charge=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' "
|
||||
+ "WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ")
|
||||
.append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Charge=" + no);
|
||||
//
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Product and Charge, ' "
|
||||
+ "WHERE M_Product_ID IS NOT NULL AND C_Charge_ID IS NOT NULL "
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Product and Charge, ' ")
|
||||
.append("WHERE M_Product_ID IS NOT NULL AND C_Charge_ID IS NOT NULL ")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Product and Charge exclusive=" + no);
|
||||
|
||||
// Tax
|
||||
sql = new StringBuffer ("UPDATE I_Order o "
|
||||
+ "SET C_Tax_ID=(SELECT MAX(C_Tax_ID) FROM C_Tax t"
|
||||
+ " WHERE o.TaxIndicator=t.TaxIndicator AND o.AD_Client_ID=t.AD_Client_ID) "
|
||||
+ "WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order o ")
|
||||
.append("SET C_Tax_ID=(SELECT MAX(C_Tax_ID) FROM C_Tax t")
|
||||
.append(" WHERE o.TaxIndicator=t.TaxIndicator AND o.AD_Client_ID=t.AD_Client_ID) ")
|
||||
.append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Tax=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' "
|
||||
+ "WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' ")
|
||||
.append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Tax=" + no);
|
||||
|
@ -497,8 +497,8 @@ public class ImportOrder extends SvrProcess
|
|||
// -- New BPartner ---------------------------------------------------
|
||||
|
||||
// Go through Order Records w/o C_BPartner_ID
|
||||
sql = new StringBuffer ("SELECT * FROM I_Order "
|
||||
+ "WHERE I_IsImported='N' AND C_BPartner_ID IS NULL").append (clientCheck);
|
||||
sql = new StringBuilder ("SELECT * FROM I_Order ")
|
||||
.append("WHERE I_IsImported='N' AND C_BPartner_ID IS NULL").append (clientCheck);
|
||||
try
|
||||
{
|
||||
PreparedStatement pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
|
@ -618,10 +618,10 @@ public class ImportOrder extends SvrProcess
|
|||
{
|
||||
log.log(Level.SEVERE, "BP - " + sql.toString(), e);
|
||||
}
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' "
|
||||
+ "WHERE C_BPartner_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No BPartner=" + no);
|
||||
|
@ -634,8 +634,8 @@ public class ImportOrder extends SvrProcess
|
|||
int noInsertLine = 0;
|
||||
|
||||
// Go through Order Records w/o
|
||||
sql = new StringBuffer ("SELECT * FROM I_Order "
|
||||
+ "WHERE I_IsImported='N'").append (clientCheck)
|
||||
sql = new StringBuilder ("SELECT * FROM I_Order ")
|
||||
.append("WHERE I_IsImported='N'").append (clientCheck)
|
||||
.append(" ORDER BY C_BPartner_ID, BillTo_ID, C_BPartner_Location_ID, I_Order_ID");
|
||||
try
|
||||
{
|
||||
|
@ -788,15 +788,16 @@ public class ImportOrder extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_Order "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Order ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
//
|
||||
addLog (0, null, new BigDecimal (noInsert), "@C_Order_ID@: @Inserted@");
|
||||
addLog (0, null, new BigDecimal (noInsertLine), "@C_OrderLine_ID@: @Inserted@");
|
||||
return "#" + noInsert + "/" + noInsertLine;
|
||||
StringBuilder msgreturn = new StringBuilder("#").append(noInsert).append("/").append(noInsertLine);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
} // ImportOrder
|
||||
|
|
|
@ -90,7 +90,7 @@ public class ImportPayment extends SvrProcess
|
|||
p_AD_Org_ID = ba.getAD_Org_ID();
|
||||
log.info("AD_Org_ID=" + p_AD_Org_ID);
|
||||
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + ba.getAD_Client_ID();
|
||||
|
||||
|
@ -99,307 +99,307 @@ public class ImportPayment extends SvrProcess
|
|||
// Delete Old Imported
|
||||
if (p_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_Payment "
|
||||
+ "WHERE I_IsImported='Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_Payment ")
|
||||
.append("WHERE I_IsImported='Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_Payment "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (ba.getAD_Client_ID()).append ("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),");
|
||||
sql.append(" IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL OR AD_Client_ID IS NULL OR AD_Org_ID IS NULL OR AD_Client_ID=0 OR AD_Org_ID=0");
|
||||
sql = new StringBuilder ("UPDATE I_Payment ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID,").append (ba.getAD_Client_ID()).append ("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID,").append (p_AD_Org_ID).append ("),");
|
||||
sql.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL OR AD_Client_ID IS NULL OR AD_Org_ID IS NULL OR AD_Client_ID=0 OR AD_Org_ID=0");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info ("Reset=" + no);
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Payment o "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '"
|
||||
+ "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0"
|
||||
+ " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment o ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '")
|
||||
.append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0")
|
||||
.append(" OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid Org=" + no);
|
||||
|
||||
// Set Bank Account
|
||||
sql = new StringBuffer("UPDATE I_Payment i "
|
||||
+ "SET C_BankAccount_ID="
|
||||
+ "( "
|
||||
+ " SELECT C_BankAccount_ID "
|
||||
+ " FROM C_BankAccount a, C_Bank b "
|
||||
+ " WHERE b.IsOwnBank='Y' "
|
||||
+ " AND a.AD_Client_ID=i.AD_Client_ID "
|
||||
+ " AND a.C_Bank_ID=b.C_Bank_ID "
|
||||
+ " AND a.AccountNo=i.BankAccountNo "
|
||||
+ " AND b.RoutingNo=i.RoutingNo "
|
||||
+ " OR b.SwiftCode=i.RoutingNo "
|
||||
+ ") "
|
||||
+ "WHERE i.C_BankAccount_ID IS NULL "
|
||||
+ "AND i.I_IsImported<>'Y' "
|
||||
+ "OR i.I_IsImported IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment i ")
|
||||
.append("SET C_BankAccount_ID=")
|
||||
.append("( ")
|
||||
.append(" SELECT C_BankAccount_ID ")
|
||||
.append(" FROM C_BankAccount a, C_Bank b ")
|
||||
.append(" WHERE b.IsOwnBank='Y' ")
|
||||
.append(" AND a.AD_Client_ID=i.AD_Client_ID ")
|
||||
.append(" AND a.C_Bank_ID=b.C_Bank_ID ")
|
||||
.append(" AND a.AccountNo=i.BankAccountNo ")
|
||||
.append(" AND b.RoutingNo=i.RoutingNo ")
|
||||
.append(" OR b.SwiftCode=i.RoutingNo ")
|
||||
.append(") ")
|
||||
.append("WHERE i.C_BankAccount_ID IS NULL ")
|
||||
.append("AND i.I_IsImported<>'Y' ")
|
||||
.append("OR i.I_IsImported IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Bank Account (With Routing No)=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_Payment i "
|
||||
+ "SET C_BankAccount_ID="
|
||||
+ "( "
|
||||
+ " SELECT C_BankAccount_ID "
|
||||
+ " FROM C_BankAccount a, C_Bank b "
|
||||
+ " WHERE b.IsOwnBank='Y' "
|
||||
+ " AND a.C_Bank_ID=b.C_Bank_ID "
|
||||
+ " AND a.AccountNo=i.BankAccountNo "
|
||||
+ " AND a.AD_Client_ID=i.AD_Client_ID "
|
||||
+ ") "
|
||||
+ "WHERE i.C_BankAccount_ID IS NULL "
|
||||
+ "AND i.I_isImported<>'Y' "
|
||||
+ "OR i.I_isImported IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment i ")
|
||||
.append("SET C_BankAccount_ID=")
|
||||
.append("( ")
|
||||
.append(" SELECT C_BankAccount_ID ")
|
||||
.append(" FROM C_BankAccount a, C_Bank b ")
|
||||
.append(" WHERE b.IsOwnBank='Y' ")
|
||||
.append(" AND a.C_Bank_ID=b.C_Bank_ID ")
|
||||
.append(" AND a.AccountNo=i.BankAccountNo ")
|
||||
.append(" AND a.AD_Client_ID=i.AD_Client_ID ")
|
||||
.append(") ")
|
||||
.append("WHERE i.C_BankAccount_ID IS NULL ")
|
||||
.append("AND i.I_isImported<>'Y' ")
|
||||
.append("OR i.I_isImported IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Bank Account (Without Routing No)=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_Payment i "
|
||||
+ "SET C_BankAccount_ID=(SELECT C_BankAccount_ID FROM C_BankAccount a WHERE a.C_BankAccount_ID=").append(p_C_BankAccount_ID);
|
||||
sql.append(" and a.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE i.C_BankAccount_ID IS NULL "
|
||||
+ "AND i.BankAccountNo IS NULL "
|
||||
+ "AND i.I_isImported<>'Y' "
|
||||
+ "OR i.I_isImported IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment i ")
|
||||
.append("SET C_BankAccount_ID=(SELECT C_BankAccount_ID FROM C_BankAccount a WHERE a.C_BankAccount_ID=").append(p_C_BankAccount_ID);
|
||||
sql.append(" and a.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE i.C_BankAccount_ID IS NULL ")
|
||||
.append("AND i.BankAccountNo IS NULL ")
|
||||
.append("AND i.I_isImported<>'Y' ")
|
||||
.append("OR i.I_isImported IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Bank Account=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Bank Account, ' "
|
||||
+ "WHERE C_BankAccount_ID IS NULL "
|
||||
+ "AND I_isImported<>'Y' "
|
||||
+ "OR I_isImported IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET I_isImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Bank Account, ' ")
|
||||
.append("WHERE C_BankAccount_ID IS NULL ")
|
||||
.append("AND I_isImported<>'Y' ")
|
||||
.append("OR I_isImported IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid Bank Account=" + no);
|
||||
|
||||
// Set Currency
|
||||
sql = new StringBuffer ("UPDATE I_Payment i "
|
||||
+ "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_Currency_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment i ")
|
||||
.append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c")
|
||||
.append(" WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ")
|
||||
.append("WHERE C_Currency_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Set Currency=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_Payment i "
|
||||
+ "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=i.C_BankAccount_ID) "
|
||||
+ "WHERE i.C_Currency_ID IS NULL "
|
||||
+ "AND i.ISO_Code IS NULL").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment i ")
|
||||
.append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=i.C_BankAccount_ID) ")
|
||||
.append("WHERE i.C_Currency_ID IS NULL ")
|
||||
.append("AND i.ISO_Code IS NULL").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Set Currency=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Currency,' "
|
||||
+ "WHERE C_Currency_ID IS NULL "
|
||||
+ "AND I_IsImported<>'E' "
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Currency,' ")
|
||||
.append("WHERE C_Currency_ID IS NULL ")
|
||||
.append("AND I_IsImported<>'E' ")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No Currency=" + no);
|
||||
|
||||
// Set Amount
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET ChargeAmt=0 "
|
||||
+ "WHERE ChargeAmt IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET ChargeAmt=0 ")
|
||||
.append("WHERE ChargeAmt IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Charge Amount=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET TaxAmt=0 "
|
||||
+ "WHERE TaxAmt IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET TaxAmt=0 ")
|
||||
.append("WHERE TaxAmt IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Tax Amount=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET WriteOffAmt=0 "
|
||||
+ "WHERE WriteOffAmt IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET WriteOffAmt=0 ")
|
||||
.append("WHERE WriteOffAmt IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("WriteOff Amount=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET DiscountAmt=0 "
|
||||
+ "WHERE DiscountAmt IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET DiscountAmt=0 ")
|
||||
.append("WHERE DiscountAmt IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Discount Amount=" + no);
|
||||
//
|
||||
|
||||
// Set Date
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET DateTrx=Created "
|
||||
+ "WHERE DateTrx IS NULL "
|
||||
+ "AND I_isImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET DateTrx=Created ")
|
||||
.append("WHERE DateTrx IS NULL ")
|
||||
.append("AND I_isImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Trx Date=" + no);
|
||||
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET DateAcct=DateTrx "
|
||||
+ "WHERE DateAcct IS NULL "
|
||||
+ "AND I_isImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET DateAcct=DateTrx ")
|
||||
.append("WHERE DateAcct IS NULL ")
|
||||
.append("AND I_isImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Acct Date=" + no);
|
||||
|
||||
// Invoice
|
||||
sql = new StringBuffer ("UPDATE I_Payment i "
|
||||
+ "SET C_Invoice_ID=(SELECT MAX(C_Invoice_ID) FROM C_Invoice ii"
|
||||
+ " WHERE i.InvoiceDocumentNo=ii.DocumentNo AND i.AD_Client_ID=ii.AD_Client_ID) "
|
||||
+ "WHERE C_Invoice_ID IS NULL AND InvoiceDocumentNo IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment i ")
|
||||
.append("SET C_Invoice_ID=(SELECT MAX(C_Invoice_ID) FROM C_Invoice ii")
|
||||
.append(" WHERE i.InvoiceDocumentNo=ii.DocumentNo AND i.AD_Client_ID=ii.AD_Client_ID) ")
|
||||
.append("WHERE C_Invoice_ID IS NULL AND InvoiceDocumentNo IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set Invoice from DocumentNo=" + no);
|
||||
|
||||
// BPartner
|
||||
sql = new StringBuffer ("UPDATE I_Payment i "
|
||||
+ "SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp"
|
||||
+ " WHERE i.BPartnerValue=bp.Value AND i.AD_Client_ID=bp.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment i ")
|
||||
.append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp")
|
||||
.append(" WHERE i.BPartnerValue=bp.Value AND i.AD_Client_ID=bp.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set BP from Value=" + no);
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Payment i "
|
||||
+ "SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_Invoice ii"
|
||||
+ " WHERE i.C_Invoice_ID=ii.C_Invoice_ID AND i.AD_Client_ID=ii.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND C_Invoice_ID IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment i ")
|
||||
.append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_Invoice ii")
|
||||
.append(" WHERE i.C_Invoice_ID=ii.C_Invoice_ID AND i.AD_Client_ID=ii.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND C_Invoice_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set BP from Invoice=" + no);
|
||||
|
||||
sql = new StringBuffer ("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner,' "
|
||||
+ "WHERE C_BPartner_ID IS NULL "
|
||||
+ "AND I_IsImported<>'E' "
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner,' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL ")
|
||||
.append("AND I_IsImported<>'E' ")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No BPartner=" + no);
|
||||
|
||||
|
||||
// Check Payment<->Invoice combination
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->Invoice, ' "
|
||||
+ "WHERE I_Payment_ID IN "
|
||||
+ "(SELECT I_Payment_ID "
|
||||
+ "FROM I_Payment i"
|
||||
+ " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) "
|
||||
+ "WHERE i.C_Invoice_ID IS NOT NULL "
|
||||
+ " AND p.C_Invoice_ID IS NOT NULL "
|
||||
+ " AND p.C_Invoice_ID<>i.C_Invoice_ID) ")
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->Invoice, ' ")
|
||||
.append("WHERE I_Payment_ID IN ")
|
||||
.append("(SELECT I_Payment_ID ")
|
||||
.append("FROM I_Payment i")
|
||||
.append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ")
|
||||
.append("WHERE i.C_Invoice_ID IS NOT NULL ")
|
||||
.append(" AND p.C_Invoice_ID IS NOT NULL ")
|
||||
.append(" AND p.C_Invoice_ID<>i.C_Invoice_ID) ")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Payment<->Invoice Mismatch=" + no);
|
||||
|
||||
// Check Payment<->BPartner combination
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->BPartner, ' "
|
||||
+ "WHERE I_Payment_ID IN "
|
||||
+ "(SELECT I_Payment_ID "
|
||||
+ "FROM I_Payment i"
|
||||
+ " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) "
|
||||
+ "WHERE i.C_BPartner_ID IS NOT NULL "
|
||||
+ " AND p.C_BPartner_ID IS NOT NULL "
|
||||
+ " AND p.C_BPartner_ID<>i.C_BPartner_ID) ")
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Payment<->BPartner, ' ")
|
||||
.append("WHERE I_Payment_ID IN ")
|
||||
.append("(SELECT I_Payment_ID ")
|
||||
.append("FROM I_Payment i")
|
||||
.append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ")
|
||||
.append("WHERE i.C_BPartner_ID IS NOT NULL ")
|
||||
.append(" AND p.C_BPartner_ID IS NOT NULL ")
|
||||
.append(" AND p.C_BPartner_ID<>i.C_BPartner_ID) ")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Payment<->BPartner Mismatch=" + no);
|
||||
|
||||
// Check Invoice<->BPartner combination
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice<->BPartner, ' "
|
||||
+ "WHERE I_Payment_ID IN "
|
||||
+ "(SELECT I_Payment_ID "
|
||||
+ "FROM I_Payment i"
|
||||
+ " INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID) "
|
||||
+ "WHERE i.C_BPartner_ID IS NOT NULL "
|
||||
+ " AND v.C_BPartner_ID IS NOT NULL "
|
||||
+ " AND v.C_BPartner_ID<>i.C_BPartner_ID) ")
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice<->BPartner, ' ")
|
||||
.append("WHERE I_Payment_ID IN ")
|
||||
.append("(SELECT I_Payment_ID ")
|
||||
.append("FROM I_Payment i")
|
||||
.append(" INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID) ")
|
||||
.append("WHERE i.C_BPartner_ID IS NOT NULL ")
|
||||
.append(" AND v.C_BPartner_ID IS NOT NULL ")
|
||||
.append(" AND v.C_BPartner_ID<>i.C_BPartner_ID) ")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Invoice<->BPartner Mismatch=" + no);
|
||||
|
||||
// Check Invoice.BPartner<->Payment.BPartner combination
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice.BPartner<->Payment.BPartner, ' "
|
||||
+ "WHERE I_Payment_ID IN "
|
||||
+ "(SELECT I_Payment_ID "
|
||||
+ "FROM I_Payment i"
|
||||
+ " INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID)"
|
||||
+ " INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) "
|
||||
+ "WHERE p.C_Invoice_ID<>v.C_Invoice_ID"
|
||||
+ " AND v.C_BPartner_ID<>p.C_BPartner_ID) ")
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Err=Invalid Invoice.BPartner<->Payment.BPartner, ' ")
|
||||
.append("WHERE I_Payment_ID IN ")
|
||||
.append("(SELECT I_Payment_ID ")
|
||||
.append("FROM I_Payment i")
|
||||
.append(" INNER JOIN C_Invoice v ON (i.C_Invoice_ID=v.C_Invoice_ID)")
|
||||
.append(" INNER JOIN C_Payment p ON (i.C_Payment_ID=p.C_Payment_ID) ")
|
||||
.append("WHERE p.C_Invoice_ID<>v.C_Invoice_ID")
|
||||
.append(" AND v.C_BPartner_ID<>p.C_BPartner_ID) ")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Invoice.BPartner<->Payment.BPartner Mismatch=" + no);
|
||||
|
||||
// TrxType
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET TrxType='S' " // MPayment.TRXTYPE_Sales
|
||||
+ "WHERE TrxType IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET TrxType='S' ") // MPayment.TRXTYPE_Sales
|
||||
.append("WHERE TrxType IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("TrxType Default=" + no);
|
||||
|
||||
// TenderType
|
||||
sql = new StringBuffer("UPDATE I_Payment "
|
||||
+ "SET TenderType='K' " // MPayment.TENDERTYPE_Check
|
||||
+ "WHERE TenderType IS NULL "
|
||||
+ "AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder("UPDATE I_Payment ")
|
||||
.append("SET TenderType='K' ") // MPayment.TENDERTYPE_Check
|
||||
.append("WHERE TenderType IS NULL ")
|
||||
.append("AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("TenderType Default=" + no);
|
||||
|
||||
// Document Type
|
||||
sql = new StringBuffer ("UPDATE I_Payment i "
|
||||
+ "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=i.DocTypeName"
|
||||
+ " AND d.DocBaseType IN ('ARR','APP') AND i.AD_Client_ID=d.AD_Client_ID) "
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment i ")
|
||||
.append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=i.DocTypeName")
|
||||
.append(" AND d.DocBaseType IN ('ARR','APP') AND i.AD_Client_ID=d.AD_Client_ID) ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine("Set DocType=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' "
|
||||
+ "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ")
|
||||
.append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("Invalid DocTypeName=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' "
|
||||
+ "WHERE C_DocType_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append (clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' ")
|
||||
.append("WHERE C_DocType_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append (clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning ("No DocType=" + no);
|
||||
|
@ -407,9 +407,9 @@ public class ImportPayment extends SvrProcess
|
|||
commitEx();
|
||||
|
||||
//Import Bank Statement
|
||||
sql = new StringBuffer("SELECT * FROM I_Payment"
|
||||
+ " WHERE I_IsImported='N'"
|
||||
+ " ORDER BY C_BankAccount_ID, CheckNo, DateTrx, R_AuthCode");
|
||||
sql = new StringBuilder("SELECT * FROM I_Payment")
|
||||
.append(" WHERE I_IsImported='N'")
|
||||
.append(" ORDER BY C_BankAccount_ID, CheckNo, DateTrx, R_AuthCode");
|
||||
|
||||
MBankAccount account = null;
|
||||
PreparedStatement pstmt = null;
|
||||
|
@ -526,9 +526,9 @@ public class ImportPayment extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_Payment "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Payment ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
//
|
||||
|
|
|
@ -83,7 +83,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = getWhereClause();
|
||||
|
||||
|
@ -92,43 +92,43 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
// Delete Old Imported
|
||||
if (m_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_Product "
|
||||
+ "WHERE I_IsImported='Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_Product ")
|
||||
.append("WHERE I_IsImported='Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Delete Old Imported =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IaActive, Created/Updated, ProductType
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID, 0),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " ProductType = COALESCE (ProductType, 'I'),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),")
|
||||
.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" ProductType = COALESCE (ProductType, 'I'),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Reset=" + no);
|
||||
|
||||
ModelValidationEngine.get().fireImportValidate(this, null, null, ImportValidator.TIMING_BEFORE_VALIDATE);
|
||||
|
||||
// Set Optional BPartner
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p"
|
||||
+ " WHERE i.BPartner_Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE C_BPartner_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_BPartner p")
|
||||
.append(" WHERE i.BPartner_Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE C_BPartner_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("BPartner=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner,' "
|
||||
+ "WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner,' ")
|
||||
.append("WHERE C_BPartner_ID IS NULL AND BPartner_Value IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid BPartner=" + no);
|
||||
|
@ -136,48 +136,48 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
|
||||
// **** Find Product
|
||||
// EAN/UPC
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p"
|
||||
+ " WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p")
|
||||
.append(" WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Product Existing UPC=" + no);
|
||||
|
||||
// Value
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p"
|
||||
+ " WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p")
|
||||
.append(" WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Product Existing Value=" + no);
|
||||
|
||||
// BP ProdNo
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET M_Product_ID=(SELECT M_Product_ID FROM M_Product_po p"
|
||||
+ " WHERE i.C_BPartner_ID=p.C_BPartner_ID"
|
||||
+ " AND i.VendorProductNo=p.VendorProductNo AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET M_Product_ID=(SELECT M_Product_ID FROM M_Product_po p")
|
||||
.append(" WHERE i.C_BPartner_ID=p.C_BPartner_ID")
|
||||
.append(" AND i.VendorProductNo=p.VendorProductNo AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Product Existing Vendor ProductNo=" + no);
|
||||
|
||||
// Set Product Category
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET ProductCategory_Value=(SELECT MAX(Value) FROM M_Product_Category"
|
||||
+ " WHERE IsDefault='Y' AND AD_Client_ID=").append(m_AD_Client_ID).append(") "
|
||||
+ "WHERE ProductCategory_Value IS NULL AND M_Product_Category_ID IS NULL"
|
||||
+ " AND M_Product_ID IS NULL" // set category only if product not found
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET ProductCategory_Value=(SELECT MAX(Value) FROM M_Product_Category")
|
||||
.append(" WHERE IsDefault='Y' AND AD_Client_ID=").append(m_AD_Client_ID).append(") ")
|
||||
.append("WHERE ProductCategory_Value IS NULL AND M_Product_Category_ID IS NULL")
|
||||
.append(" AND M_Product_ID IS NULL") // set category only if product not found
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Category Default Value=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET M_Product_Category_ID=(SELECT M_Product_Category_ID FROM M_Product_Category c"
|
||||
+ " WHERE i.ProductCategory_Value=c.Value AND i.AD_Client_ID=c.AD_Client_ID) "
|
||||
+ "WHERE ProductCategory_Value IS NOT NULL AND M_Product_Category_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET M_Product_Category_ID=(SELECT M_Product_Category_ID FROM M_Product_Category c")
|
||||
.append(" WHERE i.ProductCategory_Value=c.Value AND i.AD_Client_ID=c.AD_Client_ID) ")
|
||||
.append("WHERE ProductCategory_Value IS NOT NULL AND M_Product_Category_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Set Category=" + no);
|
||||
|
||||
|
@ -188,12 +188,12 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
"Discontinued","DiscontinuedBy","DiscontinuedAt","ImageURL","DescriptionURL"};
|
||||
for (int i = 0; i < strFields.length; i++)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET ").append(strFields[i]).append(" = (SELECT ").append(strFields[i]).append(" FROM M_Product p"
|
||||
+ " WHERE i.M_Product_ID=p.M_Product_ID AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NOT NULL"
|
||||
+ " AND ").append(strFields[i]).append(" IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET ").append(strFields[i]).append(" = (SELECT ").append(strFields[i]).append(" FROM M_Product p")
|
||||
.append(" WHERE i.M_Product_ID=p.M_Product_ID AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NOT NULL")
|
||||
.append(" AND ").append(strFields[i]).append(" IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine(strFields[i] + " - default from existing Product=" + no);
|
||||
|
@ -202,12 +202,12 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
"Volume","Weight","ShelfWidth","ShelfHeight","ShelfDepth","UnitsPerPallet"};
|
||||
for (int i = 0; i < numFields.length; i++)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_PRODUCT i "
|
||||
+ "SET ").append(numFields[i]).append(" = (SELECT ").append(numFields[i]).append(" FROM M_Product p"
|
||||
+ " WHERE i.M_Product_ID=p.M_Product_ID AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NOT NULL"
|
||||
+ " AND (").append(numFields[i]).append(" IS NULL OR ").append(numFields[i]).append("=0)"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PRODUCT i ")
|
||||
.append("SET ").append(numFields[i]).append(" = (SELECT ").append(numFields[i]).append(" FROM M_Product p")
|
||||
.append(" WHERE i.M_Product_ID=p.M_Product_ID AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NOT NULL")
|
||||
.append(" AND (").append(numFields[i]).append(" IS NULL OR ").append(numFields[i]).append("=0)")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine(numFields[i] + " default from existing Product=" + no);
|
||||
|
@ -219,13 +219,13 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
"Discontinued","DiscontinuedBy", "DiscontinuedAt"};
|
||||
for (int i = 0; i < strFieldsPO.length; i++)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_PRODUCT i "
|
||||
+ "SET ").append(strFieldsPO[i]).append(" = (SELECT ").append(strFieldsPO[i])
|
||||
.append(" FROM M_Product_PO p"
|
||||
+ " WHERE i.M_Product_ID=p.M_Product_ID AND i.C_BPartner_ID=p.C_BPartner_ID AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NOT NULL AND C_BPartner_ID IS NOT NULL"
|
||||
+ " AND ").append(strFieldsPO[i]).append(" IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PRODUCT i ")
|
||||
.append("SET ").append(strFieldsPO[i]).append(" = (SELECT ").append(strFieldsPO[i])
|
||||
.append(" FROM M_Product_PO p")
|
||||
.append(" WHERE i.M_Product_ID=p.M_Product_ID AND i.C_BPartner_ID=p.C_BPartner_ID AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NOT NULL AND C_BPartner_ID IS NOT NULL")
|
||||
.append(" AND ").append(strFieldsPO[i]).append(" IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine(strFieldsPO[i] + " default from existing Product PO=" + no);
|
||||
|
@ -235,111 +235,111 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
"Order_Min","Order_Pack","CostPerOrder","DeliveryTime_Promised"};
|
||||
for (int i = 0; i < numFieldsPO.length; i++)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_PRODUCT i "
|
||||
+ "SET ").append(numFieldsPO[i]).append(" = (SELECT ").append(numFieldsPO[i])
|
||||
.append(" FROM M_Product_PO p"
|
||||
+ " WHERE i.M_Product_ID=p.M_Product_ID AND i.C_BPartner_ID=p.C_BPartner_ID AND i.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE M_Product_ID IS NOT NULL AND C_BPartner_ID IS NOT NULL"
|
||||
+ " AND (").append(numFieldsPO[i]).append(" IS NULL OR ").append(numFieldsPO[i]).append("=0)"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_PRODUCT i ")
|
||||
.append("SET ").append(numFieldsPO[i]).append(" = (SELECT ").append(numFieldsPO[i])
|
||||
.append(" FROM M_Product_PO p")
|
||||
.append(" WHERE i.M_Product_ID=p.M_Product_ID AND i.C_BPartner_ID=p.C_BPartner_ID AND i.AD_Client_ID=p.AD_Client_ID) ")
|
||||
.append("WHERE M_Product_ID IS NOT NULL AND C_BPartner_ID IS NOT NULL")
|
||||
.append(" AND (").append(numFieldsPO[i]).append(" IS NULL OR ").append(numFieldsPO[i]).append("=0)")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.fine(numFieldsPO[i] + " default from existing Product PO=" + no);
|
||||
}
|
||||
|
||||
// Invalid Category
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ProdCategory,' "
|
||||
+ "WHERE M_Product_Category_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ProdCategory,' ")
|
||||
.append("WHERE M_Product_Category_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid Category=" + no);
|
||||
|
||||
|
||||
// Set UOM (System/own)
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET X12DE355 = "
|
||||
+ "(SELECT MAX(X12DE355) FROM C_UOM u WHERE u.IsDefault='Y' AND u.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE X12DE355 IS NULL AND C_UOM_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET X12DE355 = ")
|
||||
.append("(SELECT MAX(X12DE355) FROM C_UOM u WHERE u.IsDefault='Y' AND u.AD_Client_ID IN (0,i.AD_Client_ID)) ")
|
||||
.append("WHERE X12DE355 IS NULL AND C_UOM_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set UOM Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET C_UOM_ID = (SELECT C_UOM_ID FROM C_UOM u WHERE u.X12DE355=i.X12DE355 AND u.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_UOM_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET C_UOM_ID = (SELECT C_UOM_ID FROM C_UOM u WHERE u.X12DE355=i.X12DE355 AND u.AD_Client_ID IN (0,i.AD_Client_ID)) ")
|
||||
.append("WHERE C_UOM_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Set UOM=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid UOM, ' "
|
||||
+ "WHERE C_UOM_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid UOM, ' ")
|
||||
.append("WHERE C_UOM_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid UOM=" + no);
|
||||
|
||||
|
||||
// Set Currency
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET ISO_Code=(SELECT ISO_Code FROM C_Currency c"
|
||||
+ " INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)"
|
||||
+ " INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)"
|
||||
+ " WHERE ci.AD_Client_ID=i.AD_Client_ID) "
|
||||
+ "WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET ISO_Code=(SELECT ISO_Code FROM C_Currency c")
|
||||
.append(" INNER JOIN C_AcctSchema a ON (a.C_Currency_ID=c.C_Currency_ID)")
|
||||
.append(" INNER JOIN AD_ClientInfo ci ON (a.C_AcctSchema_ID=ci.C_AcctSchema1_ID)")
|
||||
.append(" WHERE ci.AD_Client_ID=i.AD_Client_ID) ")
|
||||
.append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set Currency Default=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c"
|
||||
+ " WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) "
|
||||
+ "WHERE C_Currency_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c")
|
||||
.append(" WHERE i.ISO_Code=c.ISO_Code AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ")
|
||||
.append("WHERE C_Currency_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("doIt- Set Currency=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' "
|
||||
+ "WHERE C_Currency_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Currency,' ")
|
||||
.append("WHERE C_Currency_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid Currency=" + no);
|
||||
|
||||
// Verify ProductType
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ProductType,' "
|
||||
+ "WHERE ProductType NOT IN ('E','I','R','S')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ProductType,' ")
|
||||
.append("WHERE ProductType NOT IN ('E','I','R','S')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Invalid ProductType=" + no);
|
||||
|
||||
// Unique UPC/Value
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Value not unique,' "
|
||||
+ "WHERE I_IsImported<>'Y'"
|
||||
+ " AND Value IN (SELECT Value FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY Value HAVING COUNT(*) > 1)").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Value not unique,' ")
|
||||
.append("WHERE I_IsImported<>'Y'")
|
||||
.append(" AND Value IN (SELECT Value FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY Value HAVING COUNT(*) > 1)").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Not Unique Value=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=UPC not unique,' "
|
||||
+ "WHERE I_IsImported<>'Y'"
|
||||
+ " AND UPC IN (SELECT UPC FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY UPC HAVING COUNT(*) > 1)").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=UPC not unique,' ")
|
||||
.append("WHERE I_IsImported<>'Y'")
|
||||
.append(" AND UPC IN (SELECT UPC FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY UPC HAVING COUNT(*) > 1)").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("Not Unique UPC=" + no);
|
||||
|
||||
// Mandatory Value
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory Value,' "
|
||||
+ "WHERE Value IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory Value,' ")
|
||||
.append("WHERE Value IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.warning("No Mandatory Value=" + no);
|
||||
|
@ -351,19 +351,19 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
// + " AND VendorProductNo IS NULL AND (C_BPartner_ID IS NOT NULL OR BPartner_Value IS NOT NULL)").append(clientCheck);
|
||||
// no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
// log.info(log.l3_Util, "No Mandatory VendorProductNo=" + no);
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET VendorProductNo=Value "
|
||||
+ "WHERE C_BPartner_ID IS NOT NULL AND VendorProductNo IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET VendorProductNo=Value ")
|
||||
.append("WHERE C_BPartner_ID IS NOT NULL AND VendorProductNo IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("VendorProductNo Set to Value=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=VendorProductNo not unique,' "
|
||||
+ "WHERE I_IsImported<>'Y'"
|
||||
+ " AND C_BPartner_ID IS NOT NULL"
|
||||
+ " AND (C_BPartner_ID, VendorProductNo) IN "
|
||||
+ " (SELECT C_BPartner_ID, VendorProductNo FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY C_BPartner_ID, VendorProductNo HAVING COUNT(*) > 1)")
|
||||
sql = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=VendorProductNo not unique,' ")
|
||||
.append("WHERE I_IsImported<>'Y'")
|
||||
.append(" AND C_BPartner_ID IS NOT NULL")
|
||||
.append(" AND (C_BPartner_ID, VendorProductNo) IN ")
|
||||
.append(" (SELECT C_BPartner_ID, VendorProductNo FROM I_Product ii WHERE i.AD_Client_ID=ii.AD_Client_ID GROUP BY C_BPartner_ID, VendorProductNo HAVING COUNT(*) > 1)")
|
||||
.append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
|
@ -373,8 +373,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
int C_TaxCategory_ID = 0;
|
||||
try
|
||||
{
|
||||
PreparedStatement pstmt = DB.prepareStatement
|
||||
("SELECT C_TaxCategory_ID FROM C_TaxCategory WHERE IsDefault='Y'" + clientCheck, get_TrxName());
|
||||
StringBuilder dbpst = new StringBuilder("SELECT C_TaxCategory_ID FROM C_TaxCategory WHERE IsDefault='Y'").append(clientCheck);
|
||||
PreparedStatement pstmt = DB.prepareStatement(dbpst.toString(), get_TrxName());
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
if (rs.next())
|
||||
C_TaxCategory_ID = rs.getInt(1);
|
||||
|
@ -399,7 +399,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
|
||||
// Go through Records
|
||||
log.fine("start inserting/updating ...");
|
||||
sql = new StringBuffer ("SELECT * FROM I_Product WHERE I_IsImported='N'")
|
||||
sql = new StringBuilder ("SELECT * FROM I_Product WHERE I_IsImported='N'")
|
||||
.append(clientCheck);
|
||||
try
|
||||
{
|
||||
|
@ -504,8 +504,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
}
|
||||
else
|
||||
{
|
||||
StringBuffer sql0 = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Product failed"))
|
||||
StringBuilder sql0 = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Product failed"))
|
||||
.append("WHERE I_Product_ID=").append(I_Product_ID);
|
||||
DB.executeUpdate(sql0.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -513,19 +513,19 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
}
|
||||
else // Update Product
|
||||
{
|
||||
String sqlt = "UPDATE M_PRODUCT "
|
||||
+ "SET (Value,Name,Description,DocumentNote,Help,"
|
||||
+ "UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType,"
|
||||
+ "Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet,"
|
||||
+ "Discontinued,DiscontinuedBy, DiscontinuedAt, Updated,UpdatedBy)= "
|
||||
+ "(SELECT Value,Name,Description,DocumentNote,Help,"
|
||||
+ "UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType,"
|
||||
+ "Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet,"
|
||||
+ "Discontinued,DiscontinuedBy, DiscontinuedAt, SysDate,UpdatedBy"
|
||||
+ " FROM I_Product WHERE I_Product_ID="+I_Product_ID+") "
|
||||
+ "WHERE M_Product_ID="+M_Product_ID;
|
||||
StringBuilder sqlt = new StringBuilder("UPDATE M_PRODUCT ")
|
||||
.append("SET (Value,Name,Description,DocumentNote,Help,")
|
||||
.append("UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType,")
|
||||
.append("Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet,")
|
||||
.append("Discontinued,DiscontinuedBy, DiscontinuedAt, Updated,UpdatedBy)= ")
|
||||
.append("(SELECT Value,Name,Description,DocumentNote,Help,")
|
||||
.append("UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType,")
|
||||
.append("Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet,")
|
||||
.append("Discontinued,DiscontinuedBy, DiscontinuedAt, SysDate,UpdatedBy")
|
||||
.append(" FROM I_Product WHERE I_Product_ID=").append(I_Product_ID).append(") ")
|
||||
.append("WHERE M_Product_ID=").append(M_Product_ID);
|
||||
PreparedStatement pstmt_updateProduct = DB.prepareStatement
|
||||
(sqlt, get_TrxName());
|
||||
(sqlt.toString(), get_TrxName());
|
||||
|
||||
//jz pstmt_updateProduct.setInt(1, I_Product_ID);
|
||||
// pstmt_updateProduct.setInt(2, M_Product_ID);
|
||||
|
@ -538,8 +538,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
catch (SQLException ex)
|
||||
{
|
||||
log.warning("Update Product - " + ex.toString());
|
||||
StringBuffer sql0 = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update Product: " + ex.toString()))
|
||||
StringBuilder sql0 = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update Product: " + ex.toString()))
|
||||
.append("WHERE I_Product_ID=").append(I_Product_ID);
|
||||
DB.executeUpdate(sql0.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -554,22 +554,22 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
// If Product existed, Try to Update first
|
||||
if (!newProduct)
|
||||
{
|
||||
String sqlt = "UPDATE M_Product_PO "
|
||||
+ "SET (IsCurrentVendor,C_UOM_ID,C_Currency_ID,UPC,"
|
||||
+ "PriceList,PricePO,RoyaltyAmt,PriceEffective,"
|
||||
+ "VendorProductNo,VendorCategory,Manufacturer,"
|
||||
+ "Discontinued,DiscontinuedBy, DiscontinuedAt, Order_Min,Order_Pack,"
|
||||
+ "CostPerOrder,DeliveryTime_Promised,Updated,UpdatedBy)= "
|
||||
+ "(SELECT CAST('Y' AS CHAR),C_UOM_ID,C_Currency_ID,UPC," //jz fix EDB unknown datatype error
|
||||
+ "PriceList,PricePO,RoyaltyAmt,PriceEffective,"
|
||||
+ "VendorProductNo,VendorCategory,Manufacturer,"
|
||||
+ "Discontinued,DiscontinuedBy, DiscontinuedAt, Order_Min,Order_Pack,"
|
||||
+ "CostPerOrder,DeliveryTime_Promised,SysDate,UpdatedBy"
|
||||
+ " FROM I_Product"
|
||||
+ " WHERE I_Product_ID="+I_Product_ID+") "
|
||||
+ "WHERE M_Product_ID="+M_Product_ID+" AND C_BPartner_ID="+C_BPartner_ID;
|
||||
StringBuilder sqlt = new StringBuilder("UPDATE M_Product_PO ")
|
||||
.append("SET (IsCurrentVendor,C_UOM_ID,C_Currency_ID,UPC,")
|
||||
.append("PriceList,PricePO,RoyaltyAmt,PriceEffective,")
|
||||
.append("VendorProductNo,VendorCategory,Manufacturer,")
|
||||
.append("Discontinued,DiscontinuedBy, DiscontinuedAt, Order_Min,Order_Pack,")
|
||||
.append("CostPerOrder,DeliveryTime_Promised,Updated,UpdatedBy)= ")
|
||||
.append("(SELECT CAST('Y' AS CHAR),C_UOM_ID,C_Currency_ID,UPC,") //jz fix EDB unknown datatype error
|
||||
.append("PriceList,PricePO,RoyaltyAmt,PriceEffective,")
|
||||
.append("VendorProductNo,VendorCategory,Manufacturer,")
|
||||
.append("Discontinued,DiscontinuedBy, DiscontinuedAt, Order_Min,Order_Pack,")
|
||||
.append("CostPerOrder,DeliveryTime_Promised,SysDate,UpdatedBy")
|
||||
.append(" FROM I_Product")
|
||||
.append(" WHERE I_Product_ID=").append(I_Product_ID).append(") ")
|
||||
.append("WHERE M_Product_ID=").append(M_Product_ID).append(" AND C_BPartner_ID=").append(C_BPartner_ID);
|
||||
PreparedStatement pstmt_updateProductPO = DB.prepareStatement
|
||||
(sqlt, get_TrxName());
|
||||
(sqlt.toString(), get_TrxName());
|
||||
//jz pstmt_updateProductPO.setInt(1, I_Product_ID);
|
||||
// pstmt_updateProductPO.setInt(2, M_Product_ID);
|
||||
// pstmt_updateProductPO.setInt(3, C_BPartner_ID);
|
||||
|
@ -584,8 +584,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
log.warning("Update Product_PO - " + ex.toString());
|
||||
noUpdate--;
|
||||
rollback();
|
||||
StringBuffer sql0 = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update Product_PO: " + ex.toString()))
|
||||
StringBuilder sql0 = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update Product_PO: " + ex.toString()))
|
||||
.append("WHERE I_Product_ID=").append(I_Product_ID);
|
||||
DB.executeUpdate(sql0.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -608,8 +608,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
log.warning("Insert Product_PO - " + ex.toString());
|
||||
noInsert--; // assume that product also did not exist
|
||||
rollback();
|
||||
StringBuffer sql0 = new StringBuffer ("UPDATE I_Product i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Product_PO: " + ex.toString()))
|
||||
StringBuilder sql0 = new StringBuilder ("UPDATE I_Product i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert Product_PO: " + ex.toString()))
|
||||
.append("WHERE I_Product_ID=").append(I_Product_ID);
|
||||
DB.executeUpdate(sql0.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -659,9 +659,9 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_Product "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_Product ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
addLog (0, null, new BigDecimal (noInsert), "@M_Product_ID@: @Inserted@");
|
||||
|
@ -680,7 +680,8 @@ public class ImportProduct extends SvrProcess implements ImportProcess
|
|||
|
||||
@Override
|
||||
public String getWhereClause() {
|
||||
return " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
StringBuilder msgreturn = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID);
|
||||
return msgreturn.toString();
|
||||
}
|
||||
|
||||
} // ImportProduct
|
||||
|
|
|
@ -76,181 +76,181 @@ public class ImportReportLine extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws java.lang.Exception
|
||||
{
|
||||
StringBuffer sql = null;
|
||||
StringBuilder sql = null;
|
||||
int no = 0;
|
||||
String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
|
||||
StringBuilder clientCheck = new StringBuilder(" AND AD_Client_ID=").append(m_AD_Client_ID);
|
||||
|
||||
// **** Prepare ****
|
||||
|
||||
// Delete Old Imported
|
||||
if (m_deleteOldImported)
|
||||
{
|
||||
sql = new StringBuffer ("DELETE I_ReportLine "
|
||||
+ "WHERE I_IsImported='Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("DELETE I_ReportLine ")
|
||||
.append("WHERE I_IsImported='Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Delete Old Impored =" + no);
|
||||
}
|
||||
|
||||
// Set Client, Org, IsActive, Created/Updated
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),"
|
||||
+ " AD_Org_ID = COALESCE (AD_Org_ID, 0),"
|
||||
+ " IsActive = COALESCE (IsActive, 'Y'),"
|
||||
+ " Created = COALESCE (Created, SysDate),"
|
||||
+ " CreatedBy = COALESCE (CreatedBy, 0),"
|
||||
+ " Updated = COALESCE (Updated, SysDate),"
|
||||
+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
|
||||
+ " I_ErrorMsg = ' ',"
|
||||
+ " I_IsImported = 'N' "
|
||||
+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),")
|
||||
.append(" AD_Org_ID = COALESCE (AD_Org_ID, 0),")
|
||||
.append(" IsActive = COALESCE (IsActive, 'Y'),")
|
||||
.append(" Created = COALESCE (Created, SysDate),")
|
||||
.append(" CreatedBy = COALESCE (CreatedBy, 0),")
|
||||
.append(" Updated = COALESCE (Updated, SysDate),")
|
||||
.append(" UpdatedBy = COALESCE (UpdatedBy, 0),")
|
||||
.append(" I_ErrorMsg = ' ',")
|
||||
.append(" I_IsImported = 'N' ")
|
||||
.append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Reset=" + no);
|
||||
|
||||
// ReportLineSetName (Default)
|
||||
if (m_PA_ReportLineSet_ID != 0)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine i "
|
||||
+ "SET ReportLineSetName=(SELECT Name FROM PA_ReportLineSet r"
|
||||
+ " WHERE PA_ReportLineSet_ID=").append(m_PA_ReportLineSet_ID).append(" AND i.AD_Client_ID=r.AD_Client_ID) "
|
||||
+ "WHERE ReportLineSetName IS NULL AND PA_ReportLineSet_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine i ")
|
||||
.append("SET ReportLineSetName=(SELECT Name FROM PA_ReportLineSet r")
|
||||
.append(" WHERE PA_ReportLineSet_ID=").append(m_PA_ReportLineSet_ID).append(" AND i.AD_Client_ID=r.AD_Client_ID) ")
|
||||
.append("WHERE ReportLineSetName IS NULL AND PA_ReportLineSet_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set ReportLineSetName Default=" + no);
|
||||
}
|
||||
// Set PA_ReportLineSet_ID
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine i "
|
||||
+ "SET PA_ReportLineSet_ID=(SELECT PA_ReportLineSet_ID FROM PA_ReportLineSet r"
|
||||
+ " WHERE i.ReportLineSetName=r.Name AND i.AD_Client_ID=r.AD_Client_ID) "
|
||||
+ "WHERE PA_ReportLineSet_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine i ")
|
||||
.append("SET PA_ReportLineSet_ID=(SELECT PA_ReportLineSet_ID FROM PA_ReportLineSet r")
|
||||
.append(" WHERE i.ReportLineSetName=r.Name AND i.AD_Client_ID=r.AD_Client_ID) ")
|
||||
.append("WHERE PA_ReportLineSet_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PA_ReportLineSet_ID=" + no);
|
||||
//
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ReportLineSet, ' "
|
||||
+ "WHERE PA_ReportLineSet_ID IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ReportLineSet, ' ")
|
||||
.append("WHERE PA_ReportLineSet_ID IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid ReportLineSet=" + no);
|
||||
|
||||
// Ignore if there is no Report Line Name or ID
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Ignored=NoLineName, ' "
|
||||
+ "WHERE PA_ReportLine_ID IS NULL AND Name IS NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'Ignored=NoLineName, ' ")
|
||||
.append("WHERE PA_ReportLine_ID IS NULL AND Name IS NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid LineName=" + no);
|
||||
|
||||
// Validate ElementValue
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine i "
|
||||
+ "SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM C_ElementValue e"
|
||||
+ " WHERE i.ElementValue=e.Value AND i.AD_Client_ID=e.AD_Client_ID) "
|
||||
+ "WHERE C_ElementValue_ID IS NULL AND ElementValue IS NOT NULL"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine i ")
|
||||
.append("SET C_ElementValue_ID=(SELECT C_ElementValue_ID FROM C_ElementValue e")
|
||||
.append(" WHERE i.ElementValue=e.Value AND i.AD_Client_ID=e.AD_Client_ID) ")
|
||||
.append("WHERE C_ElementValue_ID IS NULL AND ElementValue IS NOT NULL")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set C_ElementValue_ID=" + no);
|
||||
|
||||
// Validate C_ElementValue_ID
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ElementValue, ' "
|
||||
+ "WHERE C_ElementValue_ID IS NULL AND LineType<>'C'" // MReportLine.LINETYPE_Calculation
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ElementValue, ' ")
|
||||
.append("WHERE C_ElementValue_ID IS NULL AND LineType<>'C'") // MReportLine.LINETYPE_Calculation
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid AccountType=" + no);
|
||||
|
||||
// Set SeqNo
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET SeqNo=I_ReportLine_ID "
|
||||
+ "WHERE SeqNo IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET SeqNo=I_ReportLine_ID ")
|
||||
.append("WHERE SeqNo IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set SeqNo Default=" + no);
|
||||
|
||||
// Copy/Sync from first Row of Line
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine i "
|
||||
+ "SET (Description, SeqNo, IsSummary, IsPrinted, LineType, CalculationType, AmountType, PAAmountType, PAPeriodType, PostingType)="
|
||||
+ " (SELECT Description, SeqNo, IsSummary, IsPrinted, LineType, CalculationType, AmountType, PAAmountType, PAPeriodType, PostingType"
|
||||
+ " FROM I_ReportLine ii WHERE i.Name=ii.Name AND i.PA_ReportLineSet_ID=ii.PA_ReportLineSet_ID"
|
||||
+ " AND ii.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii"
|
||||
+ " WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID)) "
|
||||
+ "WHERE EXISTS (SELECT *"
|
||||
+ " FROM I_ReportLine ii WHERE i.Name=ii.Name AND i.PA_ReportLineSet_ID=ii.PA_ReportLineSet_ID"
|
||||
+ " AND ii.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii"
|
||||
+ " WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID))"
|
||||
+ " AND I_IsImported='N'").append(clientCheck); // not if previous error
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine i ")
|
||||
.append("SET (Description, SeqNo, IsSummary, IsPrinted, LineType, CalculationType, AmountType, PAAmountType, PAPeriodType, PostingType)=")
|
||||
.append(" (SELECT Description, SeqNo, IsSummary, IsPrinted, LineType, CalculationType, AmountType, PAAmountType, PAPeriodType, PostingType")
|
||||
.append(" FROM I_ReportLine ii WHERE i.Name=ii.Name AND i.PA_ReportLineSet_ID=ii.PA_ReportLineSet_ID")
|
||||
.append(" AND ii.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii")
|
||||
.append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID)) ")
|
||||
.append("WHERE EXISTS (SELECT *")
|
||||
.append(" FROM I_ReportLine ii WHERE i.Name=ii.Name AND i.PA_ReportLineSet_ID=ii.PA_ReportLineSet_ID")
|
||||
.append(" AND ii.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii")
|
||||
.append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID))")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck); // not if previous error
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Sync from first Row of Line=" + no);
|
||||
|
||||
// Validate IsSummary - (N) Y
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET IsSummary='N' "
|
||||
+ "WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET IsSummary='N' ")
|
||||
.append("WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set IsSummary Default=" + no);
|
||||
|
||||
// Validate IsPrinted - (Y) N
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET IsPrinted='Y' "
|
||||
+ "WHERE IsPrinted IS NULL OR IsPrinted NOT IN ('Y','N')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET IsPrinted='Y' ")
|
||||
.append("WHERE IsPrinted IS NULL OR IsPrinted NOT IN ('Y','N')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set IsPrinted Default=" + no);
|
||||
|
||||
// Validate Line Type - (S) C
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET LineType='S' "
|
||||
+ "WHERE LineType IS NULL OR LineType NOT IN ('S','C')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET LineType='S' ")
|
||||
.append("WHERE LineType IS NULL OR LineType NOT IN ('S','C')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set LineType Default=" + no);
|
||||
|
||||
// Validate Optional Calculation Type - A P R S
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CalculationType, ' "
|
||||
+ "WHERE CalculationType IS NOT NULL AND CalculationType NOT IN ('A','P','R','S')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CalculationType, ' ")
|
||||
.append("WHERE CalculationType IS NOT NULL AND CalculationType NOT IN ('A','P','R','S')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid CalculationType=" + no);
|
||||
|
||||
// Convert Optional Amount Type to PAAmount Type and PAPeriodType
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET PAAmountType = substr(AmountType,1,1), PAPeriodType = substr(AmountType,1,2) "
|
||||
+ "WHERE AmountType IS NOT NULL AND (PAAmountType IS NULL OR PAPeriodType IS NULL) "
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET PAAmountType = substr(AmountType,1,1), PAPeriodType = substr(AmountType,1,2) ")
|
||||
.append("WHERE AmountType IS NOT NULL AND (PAAmountType IS NULL OR PAPeriodType IS NULL) ")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Converted AmountType=" + no);
|
||||
|
||||
// Validate Optional Amount Type -
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PAAmountType, ' "
|
||||
+ "WHERE PAAmountType IS NOT NULL AND UPPER(AmountType) NOT IN ('B','C','D','Q','S','R')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PAAmountType, ' ")
|
||||
.append("WHERE PAAmountType IS NOT NULL AND UPPER(AmountType) NOT IN ('B','C','D','Q','S','R')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid AmountType=" + no);
|
||||
|
||||
// Validate Optional Period Type -
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PAPeriodType, ' "
|
||||
+ "WHERE PAPeriodType IS NOT NULL AND UPPER(AmountType) NOT IN ('P','Y','T','N')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PAPeriodType, ' ")
|
||||
.append("WHERE PAPeriodType IS NOT NULL AND UPPER(AmountType) NOT IN ('P','Y','T','N')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid PeriodType=" + no);
|
||||
|
||||
// Validate Optional Posting Type - A B E S R
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CalculationType, ' "
|
||||
+ "WHERE PostingType IS NOT NULL AND PostingType NOT IN ('A','B','E','S','R')"
|
||||
+ " AND I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CalculationType, ' ")
|
||||
.append("WHERE PostingType IS NOT NULL AND PostingType NOT IN ('A','B','E','S','R')")
|
||||
.append(" AND I_IsImported<>'Y'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Invalid PostingType=" + no);
|
||||
|
||||
// Set PA_ReportLine_ID
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine i "
|
||||
+ "SET PA_ReportLine_ID=(SELECT MAX(PA_ReportLine_ID) FROM PA_ReportLine r"
|
||||
+ " WHERE i.Name=r.Name AND i.PA_ReportLineSet_ID=r.PA_ReportLineSet_ID) "
|
||||
+ "WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine i ")
|
||||
.append("SET PA_ReportLine_ID=(SELECT MAX(PA_ReportLine_ID) FROM PA_ReportLine r")
|
||||
.append(" WHERE i.Name=r.Name AND i.PA_ReportLineSet_ID=r.PA_ReportLineSet_ID) ")
|
||||
.append("WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PA_ReportLine_ID=" + no);
|
||||
|
||||
|
@ -261,29 +261,29 @@ public class ImportReportLine extends SvrProcess
|
|||
int noUpdateLine = 0;
|
||||
|
||||
// **** Create Missing ReportLines
|
||||
sql = new StringBuffer ("SELECT DISTINCT PA_ReportLineSet_ID, Name "
|
||||
+ "FROM I_ReportLine "
|
||||
+ "WHERE I_IsImported='N' AND PA_ReportLine_ID IS NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("SELECT DISTINCT PA_ReportLineSet_ID, Name ")
|
||||
.append("FROM I_ReportLine ")
|
||||
.append("WHERE I_IsImported='N' AND PA_ReportLine_ID IS NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
try
|
||||
{
|
||||
// Insert ReportLine
|
||||
PreparedStatement pstmt_insertLine = DB.prepareStatement
|
||||
("INSERT INTO PA_ReportLine "
|
||||
+ "(PA_ReportLine_ID,PA_ReportLineSet_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "Name,SeqNo,IsPrinted,IsSummary,LineType)"
|
||||
+ "SELECT ?,PA_ReportLineSet_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID,'Y',SysDate,CreatedBy,SysDate,UpdatedBy,"
|
||||
+ "Name,SeqNo,IsPrinted,IsSummary,LineType "
|
||||
//jz + "FROM I_ReportLine "
|
||||
// + "WHERE PA_ReportLineSet_ID=? AND Name=? AND ROWNUM=1" // #2..3
|
||||
+ "FROM I_ReportLine "
|
||||
+ "WHERE I_ReportLine_ID=(SELECT MAX(I_ReportLine_ID) "
|
||||
+ "FROM I_ReportLine "
|
||||
+ "WHERE PA_ReportLineSet_ID=? AND Name=? " // #2..3
|
||||
//jz + clientCheck, get_TrxName());
|
||||
+ clientCheck + ")", get_TrxName());
|
||||
StringBuilder dbpst = new StringBuilder("INSERT INTO PA_ReportLine ")
|
||||
.append("(PA_ReportLine_ID,PA_ReportLineSet_ID,")
|
||||
.append("AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,")
|
||||
.append("Name,SeqNo,IsPrinted,IsSummary,LineType)")
|
||||
.append("SELECT ?,PA_ReportLineSet_ID,")
|
||||
.append("AD_Client_ID,AD_Org_ID,'Y',SysDate,CreatedBy,SysDate,UpdatedBy,")
|
||||
.append("Name,SeqNo,IsPrinted,IsSummary,LineType ")
|
||||
//jz + "FROM I_ReportLine "
|
||||
// + "WHERE PA_ReportLineSet_ID=? AND Name=? AND ROWNUM=1" // #2..3
|
||||
.append("FROM I_ReportLine ")
|
||||
.append("WHERE I_ReportLine_ID=(SELECT MAX(I_ReportLine_ID) ")
|
||||
.append("FROM I_ReportLine ")
|
||||
.append("WHERE PA_ReportLineSet_ID=? AND Name=? ") // #2..3
|
||||
//jz + clientCheck, get_TrxName());
|
||||
.append(clientCheck).append(")");
|
||||
PreparedStatement pstmt_insertLine = DB.prepareStatement(dbpst.toString(), get_TrxName());
|
||||
|
||||
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
|
@ -322,25 +322,25 @@ public class ImportReportLine extends SvrProcess
|
|||
}
|
||||
|
||||
// Set PA_ReportLine_ID (for newly created)
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine i "
|
||||
+ "SET PA_ReportLine_ID=(SELECT MAX(PA_ReportLine_ID) FROM PA_ReportLine r"
|
||||
+ " WHERE i.Name=r.Name AND i.PA_ReportLineSet_ID=r.PA_ReportLineSet_ID) "
|
||||
+ "WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine i ")
|
||||
.append("SET PA_ReportLine_ID=(SELECT MAX(PA_ReportLine_ID) FROM PA_ReportLine r")
|
||||
.append(" WHERE i.Name=r.Name AND i.PA_ReportLineSet_ID=r.PA_ReportLineSet_ID) ")
|
||||
.append("WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("Set PA_ReportLine_ID=" + no);
|
||||
|
||||
// **** Update ReportLine
|
||||
sql = new StringBuffer ("UPDATE PA_ReportLine r "
|
||||
+ "SET (Description,SeqNo,IsSummary,IsPrinted,LineType,CalculationType,AmountType,PAAmountType,PAPeriodType,PostingType,Updated,UpdatedBy)="
|
||||
+ " (SELECT Description,SeqNo,IsSummary,IsPrinted,LineType,CalculationType,AmountType,PAAmountType,PAPeriodType,PostingType,SysDate,UpdatedBy"
|
||||
+ " FROM I_ReportLine i WHERE r.Name=i.Name AND r.PA_ReportLineSet_ID=i.PA_ReportLineSet_ID"
|
||||
+ " AND i.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii"
|
||||
+ " WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID)) "
|
||||
+ "WHERE EXISTS (SELECT *"
|
||||
+ " FROM I_ReportLine i WHERE r.Name=i.Name AND r.PA_ReportLineSet_ID=i.PA_ReportLineSet_ID"
|
||||
+ " AND i.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii"
|
||||
+ " WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID AND i.I_IsImported='N'))")
|
||||
sql = new StringBuilder ("UPDATE PA_ReportLine r ")
|
||||
.append("SET (Description,SeqNo,IsSummary,IsPrinted,LineType,CalculationType,AmountType,PAAmountType,PAPeriodType,PostingType,Updated,UpdatedBy)=")
|
||||
.append(" (SELECT Description,SeqNo,IsSummary,IsPrinted,LineType,CalculationType,AmountType,PAAmountType,PAPeriodType,PostingType,SysDate,UpdatedBy")
|
||||
.append(" FROM I_ReportLine i WHERE r.Name=i.Name AND r.PA_ReportLineSet_ID=i.PA_ReportLineSet_ID")
|
||||
.append(" AND i.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii")
|
||||
.append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID)) ")
|
||||
.append("WHERE EXISTS (SELECT *")
|
||||
.append(" FROM I_ReportLine i WHERE r.Name=i.Name AND r.PA_ReportLineSet_ID=i.PA_ReportLineSet_ID")
|
||||
.append(" AND i.I_ReportLine_ID=(SELECT MIN(I_ReportLine_ID) FROM I_ReportLine iii")
|
||||
.append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID AND i.I_IsImported='N'))")
|
||||
.append(clientCheck);
|
||||
noUpdateLine = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.config("Update PA_ReportLine=" + noUpdateLine);
|
||||
|
@ -351,26 +351,26 @@ public class ImportReportLine extends SvrProcess
|
|||
int noUpdateSource = 0;
|
||||
|
||||
// **** Create ReportSource
|
||||
sql = new StringBuffer ("SELECT I_ReportLine_ID, PA_ReportSource_ID "
|
||||
+ "FROM I_ReportLine "
|
||||
+ "WHERE PA_ReportLine_ID IS NOT NULL"
|
||||
+ " AND I_IsImported='N'").append(clientCheck);
|
||||
sql = new StringBuilder ("SELECT I_ReportLine_ID, PA_ReportSource_ID ")
|
||||
.append("FROM I_ReportLine ")
|
||||
.append("WHERE PA_ReportLine_ID IS NOT NULL")
|
||||
.append(" AND I_IsImported='N'").append(clientCheck);
|
||||
|
||||
try
|
||||
{
|
||||
// Insert ReportSource
|
||||
PreparedStatement pstmt_insertSource = DB.prepareStatement
|
||||
("INSERT INTO PA_ReportSource "
|
||||
+ "(PA_ReportSource_ID,"
|
||||
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "PA_ReportLine_ID,ElementType,C_ElementValue_ID) "
|
||||
+ "SELECT ?,"
|
||||
+ "AD_Client_ID,AD_Org_ID,'Y',SysDate,CreatedBy,SysDate,UpdatedBy,"
|
||||
+ "PA_ReportLine_ID,'AC',C_ElementValue_ID "
|
||||
+ "FROM I_ReportLine "
|
||||
+ "WHERE I_ReportLine_ID=?"
|
||||
+ " AND I_IsImported='N'"
|
||||
+ clientCheck, get_TrxName());
|
||||
StringBuilder dbpst = new StringBuilder("INSERT INTO PA_ReportSource ")
|
||||
.append("(PA_ReportSource_ID,")
|
||||
.append("AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,")
|
||||
.append("PA_ReportLine_ID,ElementType,C_ElementValue_ID) ")
|
||||
.append("SELECT ?,")
|
||||
.append("AD_Client_ID,AD_Org_ID,'Y',SysDate,CreatedBy,SysDate,UpdatedBy,")
|
||||
.append("PA_ReportLine_ID,'AC',C_ElementValue_ID ")
|
||||
.append("FROM I_ReportLine ")
|
||||
.append("WHERE I_ReportLine_ID=?")
|
||||
.append(" AND I_IsImported='N'")
|
||||
.append(clientCheck);
|
||||
PreparedStatement pstmt_insertSource = DB.prepareStatement(dbpst.toString(), get_TrxName());
|
||||
|
||||
// Update ReportSource
|
||||
//jz
|
||||
|
@ -387,11 +387,11 @@ public class ImportReportLine extends SvrProcess
|
|||
*/
|
||||
|
||||
// Delete ReportSource - afalcone 22/02/2007 - F.R. [ 1642250 ] Import ReportLine / Very Slow Reports
|
||||
PreparedStatement pstmt_deleteSource = DB.prepareStatement
|
||||
("DELETE FROM PA_ReportSource "
|
||||
+ "WHERE C_ElementValue_ID IS NULL"
|
||||
+ " AND PA_ReportSource_ID=?"
|
||||
+ clientCheck, get_TrxName());
|
||||
dbpst = new StringBuilder("DELETE FROM PA_ReportSource ")
|
||||
.append("WHERE C_ElementValue_ID IS NULL")
|
||||
.append(" AND PA_ReportSource_ID=?")
|
||||
.append(clientCheck);
|
||||
PreparedStatement pstmt_deleteSource = DB.prepareStatement(dbpst.toString(), get_TrxName());
|
||||
//End afalcone 22/02/2007 - F.R. [ 1642250 ] Import ReportLine / Very Slow Reports
|
||||
|
||||
// Set Imported = Y
|
||||
|
@ -424,8 +424,8 @@ public class ImportReportLine extends SvrProcess
|
|||
catch (Exception ex)
|
||||
{
|
||||
log.finest("Insert ReportSource - " + ex.toString());
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert ElementSource: " + ex.toString()))
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Insert ElementSource: " + ex.toString()))
|
||||
.append("WHERE I_ReportLine_ID=").append(I_ReportLine_ID);
|
||||
DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -434,15 +434,15 @@ public class ImportReportLine extends SvrProcess
|
|||
else // update Report Source
|
||||
{
|
||||
//jz
|
||||
String sqlt="UPDATE PA_ReportSource "
|
||||
+ "SET (ElementType,C_ElementValue_ID,Updated,UpdatedBy)="
|
||||
+ " (SELECT CAST('AC' AS CHAR(2)),C_ElementValue_ID,SysDate,UpdatedBy" //jz
|
||||
+ " FROM I_ReportLine"
|
||||
+ " WHERE I_ReportLine_ID=" + I_ReportLine_ID + ") "
|
||||
+ "WHERE PA_ReportSource_ID="+PA_ReportSource_ID+" "
|
||||
+ clientCheck;
|
||||
StringBuilder sqlt= new StringBuilder("UPDATE PA_ReportSource ")
|
||||
.append("SET (ElementType,C_ElementValue_ID,Updated,UpdatedBy)=")
|
||||
.append(" (SELECT CAST('AC' AS CHAR(2)),C_ElementValue_ID,SysDate,UpdatedBy") //jz
|
||||
.append(" FROM I_ReportLine")
|
||||
.append(" WHERE I_ReportLine_ID=").append(I_ReportLine_ID).append(") ")
|
||||
.append("WHERE PA_ReportSource_ID=").append(PA_ReportSource_ID).append(" ")
|
||||
.append(clientCheck);
|
||||
PreparedStatement pstmt_updateSource = DB.prepareStatement
|
||||
(sqlt, get_TrxName());
|
||||
(sqlt.toString(), get_TrxName());
|
||||
//pstmt_updateSource.setInt(1, I_ReportLine_ID);
|
||||
//pstmt_updateSource.setInt(2, PA_ReportSource_ID);
|
||||
try
|
||||
|
@ -455,8 +455,8 @@ public class ImportReportLine extends SvrProcess
|
|||
catch (SQLException ex)
|
||||
{
|
||||
log.finest( "Update ReportSource - " + ex.toString());
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine i "
|
||||
+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update ElementSource: " + ex.toString()))
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine i ")
|
||||
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||").append(DB.TO_STRING("Update ElementSource: " + ex.toString()))
|
||||
.append("WHERE I_ReportLine_ID=").append(I_ReportLine_ID);
|
||||
DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
continue;
|
||||
|
@ -494,9 +494,9 @@ public class ImportReportLine extends SvrProcess
|
|||
}
|
||||
|
||||
// Set Error to indicator to not imported
|
||||
sql = new StringBuffer ("UPDATE I_ReportLine "
|
||||
+ "SET I_IsImported='N', Updated=SysDate "
|
||||
+ "WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
sql = new StringBuilder ("UPDATE I_ReportLine ")
|
||||
.append("SET I_IsImported='N', Updated=SysDate ")
|
||||
.append("WHERE I_IsImported<>'Y'").append(clientCheck);
|
||||
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
addLog (0, null, new BigDecimal (no), "@Errors@");
|
||||
|
|
|
@ -74,7 +74,7 @@ public class InOutGenerate extends SvrProcess
|
|||
private int m_lastC_BPartner_Location_ID = -1;
|
||||
|
||||
/** The Query sql */
|
||||
private String m_sql = null;
|
||||
private StringBuffer m_sql = null;
|
||||
|
||||
|
||||
/** Storages temp space */
|
||||
|
@ -147,38 +147,38 @@ public class InOutGenerate extends SvrProcess
|
|||
|
||||
if (p_Selection) // VInOutGen
|
||||
{
|
||||
m_sql = "SELECT C_Order.* FROM C_Order, T_Selection "
|
||||
+ "WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' AND C_Order.AD_Client_ID=? "
|
||||
+ "AND C_Order.C_Order_ID = T_Selection.T_Selection_ID "
|
||||
+ "AND T_Selection.AD_PInstance_ID=? ";
|
||||
m_sql = new StringBuffer("SELECT C_Order.* FROM C_Order, T_Selection ")
|
||||
.append("WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' AND C_Order.AD_Client_ID=? ")
|
||||
.append("AND C_Order.C_Order_ID = T_Selection.T_Selection_ID ")
|
||||
.append("AND T_Selection.AD_PInstance_ID=? ");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sql = "SELECT * FROM C_Order o "
|
||||
+ "WHERE DocStatus='CO' AND IsSOTrx='Y'"
|
||||
m_sql = new StringBuffer("SELECT * FROM C_Order o ")
|
||||
.append("WHERE DocStatus='CO' AND IsSOTrx='Y'")
|
||||
// No Offer,POS
|
||||
+ " AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType "
|
||||
+ "WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR'))"
|
||||
+ " AND o.IsDropShip='N'"
|
||||
.append(" AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType ")
|
||||
.append("WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR'))")
|
||||
.append(" AND o.IsDropShip='N'")
|
||||
// No Manual
|
||||
+ " AND o.DeliveryRule<>'M'"
|
||||
.append(" AND o.DeliveryRule<>'M'")
|
||||
// Open Order Lines with Warehouse
|
||||
+ " AND EXISTS (SELECT * FROM C_OrderLine ol "
|
||||
+ "WHERE ol.M_Warehouse_ID=?"; // #1
|
||||
.append(" AND EXISTS (SELECT * FROM C_OrderLine ol ")
|
||||
.append("WHERE ol.M_Warehouse_ID=?"); // #1
|
||||
if (p_DatePromised != null)
|
||||
m_sql += " AND TRUNC(ol.DatePromised)<=?"; // #2
|
||||
m_sql += " AND o.C_Order_ID=ol.C_Order_ID AND ol.QtyOrdered<>ol.QtyDelivered)";
|
||||
m_sql.append(" AND TRUNC(ol.DatePromised)<=?"); // #2
|
||||
m_sql.append(" AND o.C_Order_ID=ol.C_Order_ID AND ol.QtyOrdered<>ol.QtyDelivered)");
|
||||
//
|
||||
if (p_C_BPartner_ID != 0)
|
||||
m_sql += " AND o.C_BPartner_ID=?"; // #3
|
||||
m_sql.append(" AND o.C_BPartner_ID=?"); // #3
|
||||
}
|
||||
m_sql += " ORDER BY M_Warehouse_ID, PriorityRule, M_Shipper_ID, C_BPartner_ID, C_BPartner_Location_ID, C_Order_ID";
|
||||
m_sql.append(" ORDER BY M_Warehouse_ID, PriorityRule, M_Shipper_ID, C_BPartner_ID, C_BPartner_Location_ID, C_Order_ID");
|
||||
// m_sql += " FOR UPDATE";
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (m_sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement (m_sql.toString(), get_TrxName());
|
||||
int index = 1;
|
||||
if (p_Selection)
|
||||
{
|
||||
|
@ -196,7 +196,7 @@ public class InOutGenerate extends SvrProcess
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, m_sql, e);
|
||||
log.log(Level.SEVERE, m_sql.toString(), e);
|
||||
}
|
||||
return generate(pstmt);
|
||||
} // doIt
|
||||
|
@ -228,23 +228,23 @@ public class InOutGenerate extends SvrProcess
|
|||
Timestamp minGuaranteeDate = m_movementDate;
|
||||
boolean completeOrder = MOrder.DELIVERYRULE_CompleteOrder.equals(order.getDeliveryRule());
|
||||
// OrderLine WHERE
|
||||
String where = " AND M_Warehouse_ID=" + p_M_Warehouse_ID;
|
||||
StringBuilder where = new StringBuilder(" AND M_Warehouse_ID=").append(p_M_Warehouse_ID);
|
||||
if (p_DatePromised != null)
|
||||
where += " AND (TRUNC(DatePromised)<=" + DB.TO_DATE(p_DatePromised, true)
|
||||
+ " OR DatePromised IS NULL)";
|
||||
where.append(" AND (TRUNC(DatePromised)<=").append(DB.TO_DATE(p_DatePromised, true))
|
||||
.append(" OR DatePromised IS NULL)");
|
||||
// Exclude Auto Delivery if not Force
|
||||
if (!MOrder.DELIVERYRULE_Force.equals(order.getDeliveryRule()))
|
||||
where += " AND (C_OrderLine.M_Product_ID IS NULL"
|
||||
+ " OR EXISTS (SELECT * FROM M_Product p "
|
||||
+ "WHERE C_OrderLine.M_Product_ID=p.M_Product_ID"
|
||||
+ " AND IsExcludeAutoDelivery='N'))";
|
||||
where.append(" AND (C_OrderLine.M_Product_ID IS NULL")
|
||||
.append(" OR EXISTS (SELECT * FROM M_Product p ")
|
||||
.append("WHERE C_OrderLine.M_Product_ID=p.M_Product_ID")
|
||||
.append(" AND IsExcludeAutoDelivery='N'))");
|
||||
// Exclude Unconfirmed
|
||||
if (!p_IsUnconfirmedInOut)
|
||||
where += " AND NOT EXISTS (SELECT * FROM M_InOutLine iol"
|
||||
+ " INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) "
|
||||
+ "WHERE iol.C_OrderLine_ID=C_OrderLine.C_OrderLine_ID AND io.DocStatus IN ('IP','WC'))";
|
||||
where.append(" AND NOT EXISTS (SELECT * FROM M_InOutLine iol")
|
||||
.append(" INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) ")
|
||||
.append("WHERE iol.C_OrderLine_ID=C_OrderLine.C_OrderLine_ID AND io.DocStatus IN ('IP','WC'))");
|
||||
// Deadlock Prevention - Order by M_Product_ID
|
||||
MOrderLine[] lines = order.getLines (where, "C_BPartner_Location_ID, M_Product_ID");
|
||||
MOrderLine[] lines = order.getLines (where.toString(), "C_BPartner_Location_ID, M_Product_ID");
|
||||
for (int i = 0; i < lines.length; i++)
|
||||
{
|
||||
MOrderLine line = lines[i];
|
||||
|
@ -272,18 +272,18 @@ public class InOutGenerate extends SvrProcess
|
|||
line.getC_OrderLine_ID(), where2, null);
|
||||
for (int j = 0; j < iols.length; j++)
|
||||
unconfirmedShippedQty = unconfirmedShippedQty.add(iols[j].getMovementQty());
|
||||
String logInfo = "Unconfirmed Qty=" + unconfirmedShippedQty
|
||||
+ " - ToDeliver=" + toDeliver + "->";
|
||||
StringBuilder logInfo = new StringBuilder("Unconfirmed Qty=").append(unconfirmedShippedQty)
|
||||
.append(" - ToDeliver=").append(toDeliver).append("->");
|
||||
toDeliver = toDeliver.subtract(unconfirmedShippedQty);
|
||||
logInfo += toDeliver;
|
||||
logInfo.append(toDeliver);
|
||||
if (toDeliver.signum() < 0)
|
||||
{
|
||||
toDeliver = Env.ZERO;
|
||||
logInfo += " (set to 0)";
|
||||
logInfo.append(" (set to 0)");
|
||||
}
|
||||
// Adjust On Hand
|
||||
onHand = onHand.subtract(unconfirmedShippedQty);
|
||||
log.fine(logInfo);
|
||||
log.fine(logInfo.toString());
|
||||
}
|
||||
|
||||
// Comments & lines w/o product & services
|
||||
|
@ -397,7 +397,7 @@ public class InOutGenerate extends SvrProcess
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, m_sql, e);
|
||||
log.log(Level.SEVERE, m_sql.toString(), e);
|
||||
}
|
||||
try
|
||||
{
|
||||
|
@ -410,7 +410,8 @@ public class InOutGenerate extends SvrProcess
|
|||
pstmt = null;
|
||||
}
|
||||
completeShipment();
|
||||
return "@Created@ = " + m_created;
|
||||
StringBuilder msgreturn = new StringBuilder("@Created@ = ").append(m_created);
|
||||
return msgreturn.toString();
|
||||
} // generate
|
||||
|
||||
|
||||
|
@ -584,7 +585,8 @@ public class InOutGenerate extends SvrProcess
|
|||
|
||||
}
|
||||
m_shipment.saveEx();
|
||||
addLog(m_shipment.getM_InOut_ID(), m_shipment.getMovementDate(), null, m_shipment.getDocumentNo(),m_shipment.get_Table_ID(),m_shipment.getM_InOut_ID());
|
||||
String message = Msg.parseTranslation(getCtx(), "@ShipmentProcessed@ " + m_shipment.getDocumentNo());
|
||||
addLog(m_shipment.getM_InOut_ID(), m_shipment.getMovementDate(), null, message, m_shipment.get_Table_ID(),m_shipment.getM_InOut_ID());
|
||||
m_created++;
|
||||
|
||||
//reset storage cache as MInOut.completeIt will update m_storage
|
||||
|
|
|
@ -119,52 +119,53 @@ public class InventoryCountCreate extends SvrProcess
|
|||
if (p_DeleteOld)
|
||||
{
|
||||
//Added Line by armen
|
||||
String sql1 = "DELETE FROM M_InventoryLineMA ma WHERE EXISTS "
|
||||
+ "(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID"
|
||||
+ " AND Processed='N' AND M_Inventory_ID=" + p_M_Inventory_ID + ")";
|
||||
int no1 = DB.executeUpdate(sql1, get_TrxName());
|
||||
StringBuilder sql1 = new StringBuilder("DELETE FROM M_InventoryLineMA ma WHERE EXISTS ")
|
||||
.append("(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID")
|
||||
.append(" AND Processed='N' AND M_Inventory_ID=").append(p_M_Inventory_ID).append(")");
|
||||
int no1 = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
log.fine("doIt - Deleted MA #" + no1);
|
||||
//End of Added Line
|
||||
|
||||
String sql = "DELETE M_InventoryLine WHERE Processed='N' "
|
||||
+ "AND M_Inventory_ID=" + p_M_Inventory_ID;
|
||||
int no = DB.executeUpdate(sql, get_TrxName());
|
||||
StringBuilder sql = new StringBuilder("DELETE M_InventoryLine WHERE Processed='N' ")
|
||||
.append("AND M_Inventory_ID=").append(p_M_Inventory_ID);
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("doIt - Deleted #" + no);
|
||||
}
|
||||
|
||||
// Create Null Storage records
|
||||
if (p_QtyRange != null && p_QtyRange.equals("="))
|
||||
{
|
||||
String sql = "INSERT INTO M_Storage "
|
||||
+ "(AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID,"
|
||||
+ " QtyOnHand, QtyReserved, QtyOrdered, DateLastInventory) "
|
||||
+ "SELECT l.AD_CLIENT_ID, l.AD_ORG_ID, 'Y', SysDate, 0,SysDate, 0,"
|
||||
+ " l.M_Locator_ID, p.M_Product_ID, 0,"
|
||||
+ " 0,0,0,null "
|
||||
+ "FROM M_Locator l"
|
||||
+ " INNER JOIN M_Product p ON (l.AD_Client_ID=p.AD_Client_ID) "
|
||||
+ "WHERE l.M_Warehouse_ID=" + m_inventory.getM_Warehouse_ID();
|
||||
StringBuilder sql = new StringBuilder("INSERT INTO M_Storage ");
|
||||
sql.append("(AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,");
|
||||
sql.append(" M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID,");
|
||||
sql.append(" QtyOnHand, QtyReserved, QtyOrdered, DateLastInventory) ");
|
||||
sql.append("SELECT l.AD_CLIENT_ID, l.AD_ORG_ID, 'Y', SysDate, 0,SysDate, 0,");
|
||||
sql.append(" l.M_Locator_ID, p.M_Product_ID, 0,");
|
||||
sql.append(" 0,0,0,null ");
|
||||
sql.append("FROM M_Locator l");
|
||||
sql.append(" INNER JOIN M_Product p ON (l.AD_Client_ID=p.AD_Client_ID) ");
|
||||
sql.append("WHERE l.M_Warehouse_ID=");
|
||||
sql.append(m_inventory.getM_Warehouse_ID());
|
||||
|
||||
if (p_M_Locator_ID != 0)
|
||||
sql += " AND l.M_Locator_ID=" + p_M_Locator_ID;
|
||||
sql += " AND l.IsDefault='Y'"
|
||||
+ " AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I'"
|
||||
+ " AND NOT EXISTS (SELECT * FROM M_Storage s"
|
||||
+ " INNER JOIN M_Locator sl ON (s.M_Locator_ID=sl.M_Locator_ID) "
|
||||
+ "WHERE sl.M_Warehouse_ID=l.M_Warehouse_ID"
|
||||
+ " AND s.M_Product_ID=p.M_Product_ID)";
|
||||
int no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql.append(" AND l.M_Locator_ID=").append(p_M_Locator_ID);
|
||||
sql.append(" AND l.IsDefault='Y'")
|
||||
.append(" AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I'")
|
||||
.append(" AND NOT EXISTS (SELECT * FROM M_Storage s")
|
||||
.append(" INNER JOIN M_Locator sl ON (s.M_Locator_ID=sl.M_Locator_ID) ")
|
||||
.append("WHERE sl.M_Warehouse_ID=l.M_Warehouse_ID")
|
||||
.append(" AND s.M_Product_ID=p.M_Product_ID)");
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.fine("'0' Inserted #" + no);
|
||||
}
|
||||
|
||||
StringBuffer sql = new StringBuffer(
|
||||
"SELECT s.M_Product_ID, s.M_Locator_ID, s.M_AttributeSetInstance_ID,"
|
||||
+ " s.QtyOnHand, p.M_AttributeSet_ID "
|
||||
+ "FROM M_Product p"
|
||||
+ " INNER JOIN M_Storage s ON (s.M_Product_ID=p.M_Product_ID)"
|
||||
+ " INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID) "
|
||||
+ "WHERE l.M_Warehouse_ID=?"
|
||||
+ " AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I'");
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT s.M_Product_ID, s.M_Locator_ID, s.M_AttributeSetInstance_ID,");
|
||||
sql.append(" s.QtyOnHand, p.M_AttributeSet_ID ");
|
||||
sql.append("FROM M_Product p");
|
||||
sql.append(" INNER JOIN M_Storage s ON (s.M_Product_ID=p.M_Product_ID)");
|
||||
sql.append(" INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID) ");
|
||||
sql.append("WHERE l.M_Warehouse_ID=?");
|
||||
sql.append(" AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I'");
|
||||
//
|
||||
if (p_M_Locator_ID != 0)
|
||||
sql.append(" AND s.M_Locator_ID=?");
|
||||
|
@ -182,15 +183,17 @@ public class InventoryCountCreate extends SvrProcess
|
|||
sql.append(" AND UPPER(p.Value) LIKE ?");
|
||||
//
|
||||
if (p_M_Product_Category_ID != 0)
|
||||
sql.append(" AND p.M_Product_Category_ID IN (" + getSubCategoryWhereClause(p_M_Product_Category_ID) + ")");
|
||||
sql.append(" AND p.M_Product_Category_ID IN (")
|
||||
.append(getSubCategoryWhereClause(p_M_Product_Category_ID))
|
||||
.append(")");
|
||||
|
||||
// Do not overwrite existing records
|
||||
if (!p_DeleteOld)
|
||||
sql.append(" AND NOT EXISTS (SELECT * FROM M_InventoryLine il "
|
||||
+ "WHERE il.M_Inventory_ID=?"
|
||||
+ " AND il.M_Product_ID=s.M_Product_ID"
|
||||
+ " AND il.M_Locator_ID=s.M_Locator_ID"
|
||||
+ " AND COALESCE(il.M_AttributeSetInstance_ID,0)=COALESCE(s.M_AttributeSetInstance_ID,0))");
|
||||
sql.append(" AND NOT EXISTS (SELECT * FROM M_InventoryLine il ")
|
||||
.append("WHERE il.M_Inventory_ID=?")
|
||||
.append(" AND il.M_Product_ID=s.M_Product_ID")
|
||||
.append(" AND il.M_Locator_ID=s.M_Locator_ID")
|
||||
.append(" AND COALESCE(il.M_AttributeSetInstance_ID,0)=COALESCE(s.M_AttributeSetInstance_ID,0))");
|
||||
// + " AND il.M_AttributeSetInstance_ID=s.M_AttributeSetInstance_ID)");
|
||||
//
|
||||
sql.append(" ORDER BY l.Value, p.Value, s.QtyOnHand DESC"); // Locator/Product
|
||||
|
@ -254,15 +257,16 @@ public class InventoryCountCreate extends SvrProcess
|
|||
// Set Count to Zero
|
||||
if (p_InventoryCountSetZero)
|
||||
{
|
||||
String sql1 = "UPDATE M_InventoryLine l "
|
||||
+ "SET QtyCount=0 "
|
||||
+ "WHERE M_Inventory_ID=" + p_M_Inventory_ID;
|
||||
int no = DB.executeUpdate(sql1, get_TrxName());
|
||||
StringBuilder sql1 = new StringBuilder("UPDATE M_InventoryLine l ")
|
||||
.append("SET QtyCount=0 ")
|
||||
.append("WHERE M_Inventory_ID=").append(p_M_Inventory_ID);
|
||||
int no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
log.info("Set Cont to Zero=" + no);
|
||||
}
|
||||
|
||||
//
|
||||
return "@M_InventoryLine_ID@ - #" + count;
|
||||
StringBuilder msgreturn = new StringBuilder("@M_InventoryLine_ID@ - #").append(count);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
@ -347,7 +351,7 @@ public class InventoryCountCreate extends SvrProcess
|
|||
private String getSubCategoryWhereClause(int productCategoryId) throws SQLException, AdempiereSystemError{
|
||||
//if a node with this id is found later in the search we have a loop in the tree
|
||||
int subTreeRootParentId = 0;
|
||||
String retString = " ";
|
||||
StringBuilder retString = new StringBuilder();
|
||||
String sql = " SELECT M_Product_Category_ID, M_Product_Category_Parent_ID FROM M_Product_Category";
|
||||
final Vector<SimpleTreeNode> categories = new Vector<SimpleTreeNode>(100);
|
||||
Statement stmt = DB.createStatement();
|
||||
|
@ -358,10 +362,10 @@ public class InventoryCountCreate extends SvrProcess
|
|||
}
|
||||
categories.add(new SimpleTreeNode(rs.getInt(1), rs.getInt(2)));
|
||||
}
|
||||
retString += getSubCategoriesString(productCategoryId, categories, subTreeRootParentId);
|
||||
retString.append(getSubCategoriesString(productCategoryId, categories, subTreeRootParentId));
|
||||
rs.close();
|
||||
stmt.close();
|
||||
return retString;
|
||||
return retString.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -373,7 +377,7 @@ public class InventoryCountCreate extends SvrProcess
|
|||
* @throws AdempiereSystemError if a loop is detected
|
||||
*/
|
||||
private String getSubCategoriesString(int productCategoryId, Vector<SimpleTreeNode> categories, int loopIndicatorId) throws AdempiereSystemError {
|
||||
String ret = "";
|
||||
StringBuilder ret = new StringBuilder();
|
||||
final Iterator iter = categories.iterator();
|
||||
while (iter.hasNext()) {
|
||||
SimpleTreeNode node = (SimpleTreeNode) iter.next();
|
||||
|
@ -381,11 +385,13 @@ public class InventoryCountCreate extends SvrProcess
|
|||
if (node.getNodeId() == loopIndicatorId) {
|
||||
throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId);
|
||||
}
|
||||
ret = ret + getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId) + ",";
|
||||
ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId));
|
||||
ret.append(",");
|
||||
}
|
||||
}
|
||||
log.fine(ret);
|
||||
return ret + productCategoryId;
|
||||
log.fine(ret.toString());
|
||||
StringBuilder msgreturn = new StringBuilder(ret).append(productCategoryId);
|
||||
return msgreturn.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -75,34 +75,34 @@ public class InventoryCountUpdate extends SvrProcess
|
|||
throw new AdempiereSystemError ("Not found: M_Inventory_ID=" + p_M_Inventory_ID);
|
||||
|
||||
// Multiple Lines for one item
|
||||
String sql = "UPDATE M_InventoryLine SET IsActive='N' "
|
||||
+ "WHERE M_Inventory_ID=" + p_M_Inventory_ID
|
||||
+ " AND (M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID) IN "
|
||||
+ "(SELECT M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID "
|
||||
+ "FROM M_InventoryLine "
|
||||
+ "WHERE M_Inventory_ID=" + p_M_Inventory_ID
|
||||
+ " GROUP BY M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID "
|
||||
+ "HAVING COUNT(*) > 1)";
|
||||
int multiple = DB.executeUpdate(sql, get_TrxName());
|
||||
StringBuilder sql = new StringBuilder("UPDATE M_InventoryLine SET IsActive='N' ")
|
||||
.append("WHERE M_Inventory_ID=").append(p_M_Inventory_ID)
|
||||
.append(" AND (M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID) IN ")
|
||||
.append("(SELECT M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID ")
|
||||
.append("FROM M_InventoryLine ")
|
||||
.append("WHERE M_Inventory_ID=").append(p_M_Inventory_ID)
|
||||
.append(" GROUP BY M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID ")
|
||||
.append("HAVING COUNT(*) > 1)");
|
||||
int multiple = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Multiple=" + multiple);
|
||||
|
||||
int delMA = MInventoryLineMA.deleteInventoryMA(p_M_Inventory_ID, get_TrxName());
|
||||
log.info("DeletedMA=" + delMA);
|
||||
|
||||
// ASI
|
||||
sql = "UPDATE M_InventoryLine l "
|
||||
+ "SET (QtyBook,QtyCount) = "
|
||||
+ "(SELECT QtyOnHand,QtyOnHand FROM M_Storage s "
|
||||
+ "WHERE s.M_Product_ID=l.M_Product_ID AND s.M_Locator_ID=l.M_Locator_ID"
|
||||
+ " AND s.M_AttributeSetInstance_ID=l.M_AttributeSetInstance_ID),"
|
||||
+ " Updated=SysDate,"
|
||||
+ " UpdatedBy=" + getAD_User_ID()
|
||||
sql = new StringBuilder("UPDATE M_InventoryLine l ")
|
||||
.append("SET (QtyBook,QtyCount) = ")
|
||||
.append("(SELECT QtyOnHand,QtyOnHand FROM M_Storage s ")
|
||||
.append("WHERE s.M_Product_ID=l.M_Product_ID AND s.M_Locator_ID=l.M_Locator_ID")
|
||||
.append(" AND s.M_AttributeSetInstance_ID=l.M_AttributeSetInstance_ID),")
|
||||
.append(" Updated=SysDate,")
|
||||
.append(" UpdatedBy=").append(getAD_User_ID())
|
||||
//
|
||||
+ " WHERE M_Inventory_ID=" + p_M_Inventory_ID
|
||||
+ " AND EXISTS (SELECT * FROM M_Storage s "
|
||||
+ "WHERE s.M_Product_ID=l.M_Product_ID AND s.M_Locator_ID=l.M_Locator_ID"
|
||||
+ " AND s.M_AttributeSetInstance_ID=l.M_AttributeSetInstance_ID)";
|
||||
int no = DB.executeUpdate(sql, get_TrxName());
|
||||
.append(" WHERE M_Inventory_ID=").append(p_M_Inventory_ID)
|
||||
.append(" AND EXISTS (SELECT * FROM M_Storage s ")
|
||||
.append("WHERE s.M_Product_ID=l.M_Product_ID AND s.M_Locator_ID=l.M_Locator_ID")
|
||||
.append(" AND s.M_AttributeSetInstance_ID=l.M_AttributeSetInstance_ID)");
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Update with ASI=" + no);
|
||||
|
||||
// No ASI
|
||||
|
@ -111,17 +111,19 @@ public class InventoryCountUpdate extends SvrProcess
|
|||
// Set Count to Zero
|
||||
if (p_InventoryCountSetZero)
|
||||
{
|
||||
sql = "UPDATE M_InventoryLine l "
|
||||
+ "SET QtyCount=0 "
|
||||
+ "WHERE M_Inventory_ID=" + p_M_Inventory_ID;
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE M_InventoryLine l ")
|
||||
.append("SET QtyCount=0 ")
|
||||
.append("WHERE M_Inventory_ID=").append(p_M_Inventory_ID);
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
log.info("Set Count to Zero=" + no);
|
||||
}
|
||||
|
||||
if (multiple > 0)
|
||||
return "@M_InventoryLine_ID@ - #" + (no + noMA) + " --> @InventoryProductMultiple@";
|
||||
|
||||
return "@M_InventoryLine_ID@ - #" + no;
|
||||
if (multiple > 0){
|
||||
StringBuilder msgreturn = new StringBuilder("@M_InventoryLine_ID@ - #").append((no + noMA)).append(" --> @InventoryProductMultiple@");
|
||||
return msgreturn.toString();
|
||||
}
|
||||
StringBuilder msgreturn = new StringBuilder("@M_InventoryLine_ID@ - #").append(no);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
|
|
@ -94,23 +94,23 @@ public class InventoryValue extends SvrProcess
|
|||
MAcctSchema as = c.getAcctSchema();
|
||||
|
||||
// Delete (just to be sure)
|
||||
StringBuffer sql = new StringBuffer ("DELETE T_InventoryValue WHERE AD_PInstance_ID=");
|
||||
StringBuilder sql = new StringBuilder ("DELETE T_InventoryValue WHERE AD_PInstance_ID=");
|
||||
sql.append(getAD_PInstance_ID());
|
||||
int no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
|
||||
// Insert Standard Costs
|
||||
sql = new StringBuffer ("INSERT INTO T_InventoryValue "
|
||||
+ "(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, CostStandard) "
|
||||
+ "SELECT ").append(getAD_PInstance_ID())
|
||||
.append(", w.M_Warehouse_ID, c.M_Product_ID, c.M_AttributeSetInstance_ID,"
|
||||
+ " w.AD_Client_ID, w.AD_Org_ID, c.CurrentCostPrice "
|
||||
+ "FROM M_Warehouse w"
|
||||
+ " INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)"
|
||||
+ " INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)"
|
||||
+ " INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID))"
|
||||
+ " INNER JOIN M_CostElement ce ON (c.M_CostElement_ID=ce.M_CostElement_ID AND ce.CostingMethod='S' AND ce.CostElementType='M') "
|
||||
+ "WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID);
|
||||
sql = new StringBuilder ("INSERT INTO T_InventoryValue ")
|
||||
.append("(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, CostStandard) ")
|
||||
.append("SELECT ").append(getAD_PInstance_ID())
|
||||
.append(", w.M_Warehouse_ID, c.M_Product_ID, c.M_AttributeSetInstance_ID,")
|
||||
.append(" w.AD_Client_ID, w.AD_Org_ID, c.CurrentCostPrice ")
|
||||
.append("FROM M_Warehouse w")
|
||||
.append(" INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)")
|
||||
.append(" INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)")
|
||||
.append(" INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID))")
|
||||
.append(" INNER JOIN M_CostElement ce ON (c.M_CostElement_ID=ce.M_CostElement_ID AND ce.CostingMethod='S' AND ce.CostElementType='M') ")
|
||||
.append("WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID);
|
||||
int noInsertStd = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Inserted Std=" + noInsertStd);
|
||||
if (noInsertStd == 0)
|
||||
|
@ -120,41 +120,41 @@ public class InventoryValue extends SvrProcess
|
|||
int noInsertCost = 0;
|
||||
if (p_M_CostElement_ID != 0)
|
||||
{
|
||||
sql = new StringBuffer ("INSERT INTO T_InventoryValue "
|
||||
+ "(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, CostStandard, Cost, M_CostElement_ID) "
|
||||
+ "SELECT ").append(getAD_PInstance_ID())
|
||||
.append(", w.M_Warehouse_ID, c.M_Product_ID, c.M_AttributeSetInstance_ID,"
|
||||
+ " w.AD_Client_ID, w.AD_Org_ID, 0, c.CurrentCostPrice, c.M_CostElement_ID "
|
||||
+ "FROM M_Warehouse w"
|
||||
+ " INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)"
|
||||
+ " INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)"
|
||||
+ " INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID)) "
|
||||
+ "WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID)
|
||||
sql = new StringBuilder ("INSERT INTO T_InventoryValue ")
|
||||
.append("(AD_PInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID,")
|
||||
.append(" AD_Client_ID, AD_Org_ID, CostStandard, Cost, M_CostElement_ID) ")
|
||||
.append("SELECT ").append(getAD_PInstance_ID())
|
||||
.append(", w.M_Warehouse_ID, c.M_Product_ID, c.M_AttributeSetInstance_ID,")
|
||||
.append(" w.AD_Client_ID, w.AD_Org_ID, 0, c.CurrentCostPrice, c.M_CostElement_ID ")
|
||||
.append("FROM M_Warehouse w")
|
||||
.append(" INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)")
|
||||
.append(" INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)")
|
||||
.append(" INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID)) ")
|
||||
.append("WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID)
|
||||
.append(" AND c.M_CostElement_ID=").append(p_M_CostElement_ID)
|
||||
.append(" AND NOT EXISTS (SELECT * FROM T_InventoryValue iv "
|
||||
+ "WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID())
|
||||
.append(" AND iv.M_Warehouse_ID=w.M_Warehouse_ID"
|
||||
+ " AND iv.M_Product_ID=c.M_Product_ID"
|
||||
+ " AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID)");
|
||||
.append(" AND NOT EXISTS (SELECT * FROM T_InventoryValue iv ")
|
||||
.append("WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID())
|
||||
.append(" AND iv.M_Warehouse_ID=w.M_Warehouse_ID")
|
||||
.append(" AND iv.M_Product_ID=c.M_Product_ID")
|
||||
.append(" AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID)");
|
||||
noInsertCost = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Inserted Cost=" + noInsertCost);
|
||||
// Update Std Cost Records
|
||||
sql = new StringBuffer ("UPDATE T_InventoryValue iv "
|
||||
+ "SET (Cost, M_CostElement_ID)="
|
||||
+ "(SELECT c.CurrentCostPrice, c.M_CostElement_ID "
|
||||
+ "FROM M_Warehouse w"
|
||||
+ " INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)"
|
||||
+ " INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)"
|
||||
+ " INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID"
|
||||
+ " AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID)) "
|
||||
+ "WHERE c.M_CostElement_ID=" + p_M_CostElement_ID
|
||||
+ " AND iv.M_Warehouse_ID=w.M_Warehouse_ID"
|
||||
+ " AND iv.M_Product_ID=c.M_Product_ID"
|
||||
+ " AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID) "
|
||||
+ "WHERE EXISTS (SELECT * FROM T_InventoryValue ivv "
|
||||
+ "WHERE ivv.AD_PInstance_ID=" + getAD_PInstance_ID()
|
||||
+ " AND ivv.M_CostElement_ID IS NULL)");
|
||||
sql = new StringBuilder ("UPDATE T_InventoryValue iv ")
|
||||
.append("SET (Cost, M_CostElement_ID)=")
|
||||
.append("(SELECT c.CurrentCostPrice, c.M_CostElement_ID ")
|
||||
.append("FROM M_Warehouse w")
|
||||
.append(" INNER JOIN AD_ClientInfo ci ON (w.AD_Client_ID=ci.AD_Client_ID)")
|
||||
.append(" INNER JOIN C_AcctSchema acs ON (ci.C_AcctSchema1_ID=acs.C_AcctSchema_ID)")
|
||||
.append(" INNER JOIN M_Cost c ON (acs.C_AcctSchema_ID=c.C_AcctSchema_ID")
|
||||
.append(" AND acs.M_CostType_ID=c.M_CostType_ID AND c.AD_Org_ID IN (0, w.AD_Org_ID)) ")
|
||||
.append("WHERE c.M_CostElement_ID=").append(p_M_CostElement_ID)
|
||||
.append(" AND iv.M_Warehouse_ID=w.M_Warehouse_ID")
|
||||
.append(" AND iv.M_Product_ID=c.M_Product_ID")
|
||||
.append(" AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID) ")
|
||||
.append("WHERE EXISTS (SELECT * FROM T_InventoryValue ivv ")
|
||||
.append("WHERE ivv.AD_PInstance_ID=").append(getAD_PInstance_ID())
|
||||
.append(" AND ivv.M_CostElement_ID IS NULL)");
|
||||
int noUpdatedCost = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Updated Cost=" + noUpdatedCost);
|
||||
}
|
||||
|
@ -164,97 +164,97 @@ public class InventoryValue extends SvrProcess
|
|||
// Update Constants
|
||||
// YYYY-MM-DD HH24:MI:SS.mmmm JDBC Timestamp format
|
||||
String myDate = p_DateValue.toString();
|
||||
sql = new StringBuffer ("UPDATE T_InventoryValue SET ")
|
||||
sql = new StringBuilder ("UPDATE T_InventoryValue SET ")
|
||||
.append("DateValue=TO_DATE('").append(myDate.substring(0,10))
|
||||
.append(" 23:59:59','YYYY-MM-DD HH24:MI:SS'),")
|
||||
.append("M_PriceList_Version_ID=").append(p_M_PriceList_Version_ID).append(",")
|
||||
.append("C_Currency_ID=").append(p_C_Currency_ID)
|
||||
.append(" WHERE AD_PInstance_ID=" + getAD_PInstance_ID());
|
||||
.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Constants=" + no);
|
||||
|
||||
// Get current QtyOnHand with ASI
|
||||
sql = new StringBuffer ("UPDATE T_InventoryValue iv SET QtyOnHand = "
|
||||
+ "(SELECT SUM(QtyOnHand) FROM M_Storage s"
|
||||
+ " INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID) "
|
||||
+ "WHERE iv.M_Product_ID=s.M_Product_ID"
|
||||
+ " AND iv.M_Warehouse_ID=l.M_Warehouse_ID"
|
||||
+ " AND iv.M_AttributeSetInstance_ID=s.M_AttributeSetInstance_ID) "
|
||||
+ "WHERE AD_PInstance_ID=").append(getAD_PInstance_ID())
|
||||
sql = new StringBuilder ("UPDATE T_InventoryValue iv SET QtyOnHand = ")
|
||||
.append("(SELECT SUM(QtyOnHand) FROM M_Storage s")
|
||||
.append(" INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID) ")
|
||||
.append("WHERE iv.M_Product_ID=s.M_Product_ID")
|
||||
.append(" AND iv.M_Warehouse_ID=l.M_Warehouse_ID")
|
||||
.append(" AND iv.M_AttributeSetInstance_ID=s.M_AttributeSetInstance_ID) ")
|
||||
.append("WHERE AD_PInstance_ID=").append(getAD_PInstance_ID())
|
||||
.append(" AND iv.M_AttributeSetInstance_ID<>0");
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("QtHand with ASI=" + no);
|
||||
// Get current QtyOnHand without ASI
|
||||
sql = new StringBuffer ("UPDATE T_InventoryValue iv SET QtyOnHand = "
|
||||
+ "(SELECT SUM(QtyOnHand) FROM M_Storage s"
|
||||
+ " INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID) "
|
||||
+ "WHERE iv.M_Product_ID=s.M_Product_ID"
|
||||
+ " AND iv.M_Warehouse_ID=l.M_Warehouse_ID) "
|
||||
+ "WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID())
|
||||
sql = new StringBuilder ("UPDATE T_InventoryValue iv SET QtyOnHand = ")
|
||||
.append("(SELECT SUM(QtyOnHand) FROM M_Storage s")
|
||||
.append(" INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID) ")
|
||||
.append("WHERE iv.M_Product_ID=s.M_Product_ID")
|
||||
.append(" AND iv.M_Warehouse_ID=l.M_Warehouse_ID) ")
|
||||
.append("WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID())
|
||||
.append(" AND iv.M_AttributeSetInstance_ID=0");
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("QtHand w/o ASI=" + no);
|
||||
|
||||
// Adjust for Valuation Date
|
||||
sql = new StringBuffer("UPDATE T_InventoryValue iv "
|
||||
+ "SET QtyOnHand="
|
||||
+ "(SELECT iv.QtyOnHand - NVL(SUM(t.MovementQty), 0) "
|
||||
+ "FROM M_Transaction t"
|
||||
+ " INNER JOIN M_Locator l ON (t.M_Locator_ID=l.M_Locator_ID) "
|
||||
+ "WHERE t.M_Product_ID=iv.M_Product_ID"
|
||||
+ " AND t.M_AttributeSetInstance_ID=iv.M_AttributeSetInstance_ID"
|
||||
+ " AND t.MovementDate > iv.DateValue"
|
||||
+ " AND l.M_Warehouse_ID=iv.M_Warehouse_ID) "
|
||||
+ "WHERE iv.M_AttributeSetInstance_ID<>0"
|
||||
+ " AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
sql = new StringBuilder("UPDATE T_InventoryValue iv ")
|
||||
.append("SET QtyOnHand=")
|
||||
.append("(SELECT iv.QtyOnHand - NVL(SUM(t.MovementQty), 0) ")
|
||||
.append("FROM M_Transaction t")
|
||||
.append(" INNER JOIN M_Locator l ON (t.M_Locator_ID=l.M_Locator_ID) ")
|
||||
.append("WHERE t.M_Product_ID=iv.M_Product_ID")
|
||||
.append(" AND t.M_AttributeSetInstance_ID=iv.M_AttributeSetInstance_ID")
|
||||
.append(" AND t.MovementDate > iv.DateValue")
|
||||
.append(" AND l.M_Warehouse_ID=iv.M_Warehouse_ID) ")
|
||||
.append("WHERE iv.M_AttributeSetInstance_ID<>0" )
|
||||
.append(" AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Update with ASI=" + no);
|
||||
//
|
||||
sql = new StringBuffer("UPDATE T_InventoryValue iv "
|
||||
+ "SET QtyOnHand="
|
||||
+ "(SELECT iv.QtyOnHand - NVL(SUM(t.MovementQty), 0) "
|
||||
+ "FROM M_Transaction t"
|
||||
+ " INNER JOIN M_Locator l ON (t.M_Locator_ID=l.M_Locator_ID) "
|
||||
+ "WHERE t.M_Product_ID=iv.M_Product_ID"
|
||||
+ " AND t.MovementDate > iv.DateValue"
|
||||
+ " AND l.M_Warehouse_ID=iv.M_Warehouse_ID) "
|
||||
+ "WHERE iv.M_AttributeSetInstance_ID=0 "
|
||||
+ "AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
sql = new StringBuilder("UPDATE T_InventoryValue iv ")
|
||||
.append("SET QtyOnHand=")
|
||||
.append("(SELECT iv.QtyOnHand - NVL(SUM(t.MovementQty), 0) ")
|
||||
.append("FROM M_Transaction t")
|
||||
.append(" INNER JOIN M_Locator l ON (t.M_Locator_ID=l.M_Locator_ID) ")
|
||||
.append("WHERE t.M_Product_ID=iv.M_Product_ID")
|
||||
.append(" AND t.MovementDate > iv.DateValue")
|
||||
.append(" AND l.M_Warehouse_ID=iv.M_Warehouse_ID) ")
|
||||
.append("WHERE iv.M_AttributeSetInstance_ID=0 ")
|
||||
.append("AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
|
||||
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
|
||||
log.fine("Update w/o ASI=" + no);
|
||||
|
||||
// Delete Records w/o OnHand Qty
|
||||
sql = new StringBuffer("DELETE T_InventoryValue "
|
||||
+ "WHERE (QtyOnHand=0 OR QtyOnHand IS NULL) AND AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
sql = new StringBuilder("DELETE T_InventoryValue ")
|
||||
.append("WHERE (QtyOnHand=0 OR QtyOnHand IS NULL) AND AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
int noQty = DB.executeUpdateEx (sql.toString(), get_TrxName());
|
||||
log.fine("NoQty Deleted=" + noQty);
|
||||
|
||||
// Update Prices
|
||||
sql = new StringBuffer("UPDATE T_InventoryValue iv "
|
||||
+ "SET PricePO = "
|
||||
+ "(SELECT MAX(currencyConvert (po.PriceList,po.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, po.AD_Client_ID,po.AD_Org_ID))"
|
||||
+ " FROM M_Product_PO po WHERE po.M_Product_ID=iv.M_Product_ID"
|
||||
+ " AND po.IsCurrentVendor='Y'), "
|
||||
+ "PriceList = "
|
||||
+ "(SELECT currencyConvert(pp.PriceList,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)"
|
||||
+ " FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp"
|
||||
+ " WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID"
|
||||
+ " AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID"
|
||||
+ " AND plv.M_PriceList_ID=pl.M_PriceList_ID), "
|
||||
+ "PriceStd = "
|
||||
+ "(SELECT currencyConvert(pp.PriceStd,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)"
|
||||
+ " FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp"
|
||||
+ " WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID"
|
||||
+ " AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID"
|
||||
+ " AND plv.M_PriceList_ID=pl.M_PriceList_ID), "
|
||||
+ "PriceLimit = "
|
||||
+ "(SELECT currencyConvert(pp.PriceLimit,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)"
|
||||
+ " FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp"
|
||||
+ " WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID"
|
||||
+ " AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID"
|
||||
+ " AND plv.M_PriceList_ID=pl.M_PriceList_ID)"
|
||||
+ " WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
sql = new StringBuilder("UPDATE T_InventoryValue iv ")
|
||||
.append("SET PricePO = ")
|
||||
.append("(SELECT MAX(currencyConvert (po.PriceList,po.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, po.AD_Client_ID,po.AD_Org_ID))")
|
||||
.append(" FROM M_Product_PO po WHERE po.M_Product_ID=iv.M_Product_ID")
|
||||
.append(" AND po.IsCurrentVendor='Y'), ")
|
||||
.append("PriceList = ")
|
||||
.append("(SELECT currencyConvert(pp.PriceList,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)")
|
||||
.append(" FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp")
|
||||
.append(" WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID")
|
||||
.append(" AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID")
|
||||
.append(" AND plv.M_PriceList_ID=pl.M_PriceList_ID), ")
|
||||
.append("PriceStd = ")
|
||||
.append("(SELECT currencyConvert(pp.PriceStd,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)")
|
||||
.append(" FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp")
|
||||
.append(" WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID")
|
||||
.append(" AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID")
|
||||
.append(" AND plv.M_PriceList_ID=pl.M_PriceList_ID), ")
|
||||
.append("PriceLimit = ")
|
||||
.append("(SELECT currencyConvert(pp.PriceLimit,pl.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, pl.AD_Client_ID,pl.AD_Org_ID)")
|
||||
.append(" FROM M_PriceList pl, M_PriceList_Version plv, M_ProductPrice pp")
|
||||
.append(" WHERE pp.M_Product_ID=iv.M_Product_ID AND pp.M_PriceList_Version_ID=iv.M_PriceList_Version_ID")
|
||||
.append(" AND pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID")
|
||||
.append(" AND plv.M_PriceList_ID=pl.M_PriceList_ID)")
|
||||
.append(" WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
|
||||
no = DB.executeUpdateEx (sql.toString(), get_TrxName());
|
||||
String msg = "";
|
||||
|
@ -264,28 +264,29 @@ public class InventoryValue extends SvrProcess
|
|||
// Convert if different Currency
|
||||
if (as.getC_Currency_ID() != p_C_Currency_ID)
|
||||
{
|
||||
sql = new StringBuffer ("UPDATE T_InventoryValue iv "
|
||||
+ "SET CostStandard= "
|
||||
+ "(SELECT currencyConvert(iv.CostStandard,acs.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, iv.AD_Client_ID,iv.AD_Org_ID) "
|
||||
+ "FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=" + as.getC_AcctSchema_ID() + "),"
|
||||
+ " Cost= "
|
||||
+ "(SELECT currencyConvert(iv.Cost,acs.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, iv.AD_Client_ID,iv.AD_Org_ID) "
|
||||
+ "FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=" + as.getC_AcctSchema_ID() + ") "
|
||||
+ "WHERE iv.AD_PInstance_ID=" + getAD_PInstance_ID());
|
||||
sql = new StringBuilder ("UPDATE T_InventoryValue iv ")
|
||||
.append("SET CostStandard= ")
|
||||
.append("(SELECT currencyConvert(iv.CostStandard,acs.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, iv.AD_Client_ID,iv.AD_Org_ID) ")
|
||||
.append("FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=").append(as.getC_AcctSchema_ID()).append("),")
|
||||
.append(" Cost= ")
|
||||
.append("(SELECT currencyConvert(iv.Cost,acs.C_Currency_ID,iv.C_Currency_ID,iv.DateValue,null, iv.AD_Client_ID,iv.AD_Org_ID) ")
|
||||
.append("FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=").append(as.getC_AcctSchema_ID()).append(") ")
|
||||
.append("WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
no = DB.executeUpdateEx (sql.toString(), get_TrxName());
|
||||
log.fine("Converted=" + no);
|
||||
}
|
||||
|
||||
// Update Values
|
||||
no = DB.executeUpdateEx("UPDATE T_InventoryValue SET "
|
||||
+ "PricePOAmt = QtyOnHand * PricePO, "
|
||||
+ "PriceListAmt = QtyOnHand * PriceList, "
|
||||
+ "PriceStdAmt = QtyOnHand * PriceStd, "
|
||||
+ "PriceLimitAmt = QtyOnHand * PriceLimit, "
|
||||
+ "CostStandardAmt = QtyOnHand * CostStandard, "
|
||||
+ "CostAmt = QtyOnHand * Cost "
|
||||
+ "WHERE AD_PInstance_ID=" + getAD_PInstance_ID()
|
||||
, get_TrxName());
|
||||
StringBuilder dbeux = new StringBuilder("UPDATE T_InventoryValue SET ")
|
||||
.append("PricePOAmt = QtyOnHand * PricePO, ")
|
||||
.append("PriceListAmt = QtyOnHand * PriceList, ")
|
||||
.append("PriceStdAmt = QtyOnHand * PriceStd, ")
|
||||
.append("PriceLimitAmt = QtyOnHand * PriceLimit, ")
|
||||
.append("CostStandardAmt = QtyOnHand * CostStandard, ")
|
||||
.append("CostAmt = QtyOnHand * Cost ")
|
||||
.append("WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()
|
||||
);
|
||||
no = DB.executeUpdateEx(dbeux.toString(), get_TrxName());
|
||||
log.fine("Calculation=" + no);
|
||||
//
|
||||
return msg;
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.compiere.model.MInvoiceBatch;
|
|||
import org.compiere.model.MInvoiceBatchLine;
|
||||
import org.compiere.model.MInvoiceLine;
|
||||
import org.compiere.util.AdempiereUserError;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -142,7 +143,8 @@ public class InvoiceBatchProcess extends SvrProcess
|
|||
batch.setProcessed(true);
|
||||
batch.saveEx();
|
||||
|
||||
return "#" + m_count;
|
||||
StringBuilder msgreturn = new StringBuilder("#").append(m_count);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
|
||||
|
@ -162,7 +164,8 @@ public class InvoiceBatchProcess extends SvrProcess
|
|||
}
|
||||
m_invoice.saveEx();
|
||||
|
||||
addLog(0, m_invoice.getDateInvoiced(), m_invoice.getGrandTotal(), m_invoice.getDocumentNo(),m_invoice.get_Table_ID(),m_invoice.getC_Invoice_ID());
|
||||
String message = Msg.parseTranslation(getCtx(), "@InvoiceProcessed@ " + m_invoice.getDocumentNo());
|
||||
addLog(0, m_invoice.getDateInvoiced(), m_invoice.getGrandTotal(), message, m_invoice.get_Table_ID(), m_invoice.getC_Invoice_ID());
|
||||
m_count++;
|
||||
|
||||
m_invoice = null;
|
||||
|
|
|
@ -129,38 +129,38 @@ public class InvoiceGenerate extends SvrProcess
|
|||
+ ", C_Order_ID=" + p_C_Order_ID + ", DocAction=" + p_docAction
|
||||
+ ", Consolidate=" + p_ConsolidateDocument);
|
||||
//
|
||||
String sql = null;
|
||||
StringBuilder sql = null;
|
||||
if (p_Selection) // VInvoiceGen
|
||||
{
|
||||
sql = "SELECT C_Order.* FROM C_Order, T_Selection "
|
||||
+ "WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' "
|
||||
+ "AND C_Order.C_Order_ID = T_Selection.T_Selection_ID "
|
||||
+ "AND T_Selection.AD_PInstance_ID=? "
|
||||
+ "ORDER BY C_Order.M_Warehouse_ID, C_Order.PriorityRule, C_Order.C_BPartner_ID, C_Order.Bill_Location_ID, C_Order.C_Order_ID";
|
||||
sql = new StringBuilder("SELECT C_Order.* FROM C_Order, T_Selection ")
|
||||
.append("WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' ")
|
||||
.append("AND C_Order.C_Order_ID = T_Selection.T_Selection_ID ")
|
||||
.append("AND T_Selection.AD_PInstance_ID=? ")
|
||||
.append("ORDER BY C_Order.M_Warehouse_ID, C_Order.PriorityRule, C_Order.C_BPartner_ID, C_Order.Bill_Location_ID, C_Order.C_Order_ID");
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT * FROM C_Order o "
|
||||
+ "WHERE DocStatus IN('CO','CL') AND IsSOTrx='Y'";
|
||||
sql = new StringBuilder("SELECT * FROM C_Order o ")
|
||||
.append("WHERE DocStatus IN('CO','CL') AND IsSOTrx='Y'");
|
||||
if (p_AD_Org_ID != 0)
|
||||
sql += " AND AD_Org_ID=?";
|
||||
sql.append(" AND AD_Org_ID=?");
|
||||
if (p_C_BPartner_ID != 0)
|
||||
sql += " AND C_BPartner_ID=?";
|
||||
sql.append(" AND C_BPartner_ID=?");
|
||||
if (p_C_Order_ID != 0)
|
||||
sql += " AND C_Order_ID=?";
|
||||
sql.append(" AND C_Order_ID=?");
|
||||
//
|
||||
sql += " AND EXISTS (SELECT * FROM C_OrderLine ol "
|
||||
+ "WHERE o.C_Order_ID=ol.C_Order_ID AND ol.QtyOrdered<>ol.QtyInvoiced) "
|
||||
+ "AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType "
|
||||
+ "WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR')) "
|
||||
+ "ORDER BY M_Warehouse_ID, PriorityRule, C_BPartner_ID, Bill_Location_ID, C_Order_ID";
|
||||
sql.append(" AND EXISTS (SELECT * FROM C_OrderLine ol ")
|
||||
.append("WHERE o.C_Order_ID=ol.C_Order_ID AND ol.QtyOrdered<>ol.QtyInvoiced) ")
|
||||
.append("AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType ")
|
||||
.append("WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR')) ")
|
||||
.append("ORDER BY M_Warehouse_ID, PriorityRule, C_BPartner_ID, Bill_Location_ID, C_Order_ID");
|
||||
}
|
||||
// sql += " FOR UPDATE";
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql, get_TrxName());
|
||||
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
|
||||
int index = 1;
|
||||
if (p_Selection)
|
||||
{
|
||||
|
@ -178,7 +178,7 @@ public class InvoiceGenerate extends SvrProcess
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, sql, e);
|
||||
log.log(Level.SEVERE, sql.toString(), e);
|
||||
}
|
||||
return generate(pstmt);
|
||||
} // doIt
|
||||
|
@ -197,7 +197,8 @@ public class InvoiceGenerate extends SvrProcess
|
|||
while (rs.next ())
|
||||
{
|
||||
MOrder order = new MOrder (getCtx(), rs, get_TrxName());
|
||||
statusUpdate(Msg.getMsg(getCtx(), "Processing") + " " + order.getDocumentInfo());
|
||||
StringBuilder msgsup = new StringBuilder(Msg.getMsg(getCtx(), "Processing")).append(" ").append(order.getDocumentInfo());
|
||||
statusUpdate(msgsup.toString());
|
||||
|
||||
// New Invoice Location
|
||||
if (!p_ConsolidateDocument
|
||||
|
@ -337,7 +338,8 @@ public class InvoiceGenerate extends SvrProcess
|
|||
pstmt = null;
|
||||
}
|
||||
completeInvoice();
|
||||
return "@Created@ = " + m_created;
|
||||
StringBuilder msgreturn = new StringBuilder("@Created@ = ").append(m_created);
|
||||
return msgreturn.toString();
|
||||
} // generate
|
||||
|
||||
|
||||
|
@ -400,14 +402,14 @@ public class InvoiceGenerate extends SvrProcess
|
|||
AD_Language = Language.getBaseAD_Language();
|
||||
java.text.SimpleDateFormat format = DisplayType.getDateFormat
|
||||
(DisplayType.Date, Language.getLanguage(AD_Language));
|
||||
String reference = dt.getPrintName(m_bp.getAD_Language())
|
||||
+ ": " + ship.getDocumentNo()
|
||||
+ " - " + format.format(ship.getMovementDate());
|
||||
StringBuilder reference = new StringBuilder(dt.getPrintName(m_bp.getAD_Language()))
|
||||
.append(": ").append(ship.getDocumentNo())
|
||||
.append(" - ").append(format.format(ship.getMovementDate()));
|
||||
m_ship = ship;
|
||||
//
|
||||
MInvoiceLine line = new MInvoiceLine (m_invoice);
|
||||
line.setIsDescription(true);
|
||||
line.setDescription(reference);
|
||||
line.setDescription(reference.toString());
|
||||
line.setLine(m_line + sLine.getLine() - 2);
|
||||
if (!line.save())
|
||||
throw new IllegalStateException("Could not create Invoice Comment Line (sh)");
|
||||
|
@ -497,7 +499,8 @@ public class InvoiceGenerate extends SvrProcess
|
|||
}
|
||||
m_invoice.saveEx();
|
||||
|
||||
addLog(m_invoice.getC_Invoice_ID(), m_invoice.getDateInvoiced(), null, m_invoice.getDocumentNo(),m_invoice.get_Table_ID(),m_invoice.getC_Invoice_ID());
|
||||
String message = Msg.parseTranslation(getCtx(), "@InvoiceProcessed@ " + m_invoice.getDocumentNo());
|
||||
addLog(m_invoice.getC_Invoice_ID(), m_invoice.getDateInvoiced(), null, message, m_invoice.get_Table_ID(), m_invoice.getC_Invoice_ID());
|
||||
m_created++;
|
||||
}
|
||||
m_invoice = null;
|
||||
|
|
|
@ -117,47 +117,47 @@ public class InvoiceNGL extends SvrProcess
|
|||
p_DateReval = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
// Delete - just to be sure
|
||||
String sql = "DELETE T_InvoiceGL WHERE AD_PInstance_ID=" + getAD_PInstance_ID();
|
||||
int no = DB.executeUpdate(sql, get_TrxName());
|
||||
StringBuilder sql = new StringBuilder("DELETE T_InvoiceGL WHERE AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
int no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.info("Deleted #" + no);
|
||||
|
||||
// Insert Trx
|
||||
String dateStr = DB.TO_DATE(p_DateReval, true);
|
||||
sql = "INSERT INTO T_InvoiceGL (AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,"
|
||||
+ " AD_PInstance_ID, C_Invoice_ID, GrandTotal, OpenAmt, "
|
||||
+ " Fact_Acct_ID, AmtSourceBalance, AmtAcctBalance, "
|
||||
+ " AmtRevalDr, AmtRevalCr, C_DocTypeReval_ID, IsAllCurrencies, "
|
||||
+ " DateReval, C_ConversionTypeReval_ID, AmtRevalDrDiff, AmtRevalCrDiff, APAR) "
|
||||
sql = new StringBuilder("INSERT INTO T_InvoiceGL (AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy, Updated,UpdatedBy,")
|
||||
.append(" AD_PInstance_ID, C_Invoice_ID, GrandTotal, OpenAmt, ")
|
||||
.append(" Fact_Acct_ID, AmtSourceBalance, AmtAcctBalance, ")
|
||||
.append(" AmtRevalDr, AmtRevalCr, C_DocTypeReval_ID, IsAllCurrencies, ")
|
||||
.append(" DateReval, C_ConversionTypeReval_ID, AmtRevalDrDiff, AmtRevalCrDiff, APAR) ")
|
||||
// --
|
||||
+ "SELECT i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created,i.CreatedBy, i.Updated,i.UpdatedBy,"
|
||||
+ getAD_PInstance_ID() + ", i.C_Invoice_ID, i.GrandTotal, invoiceOpen(i.C_Invoice_ID, 0), "
|
||||
+ " fa.Fact_Acct_ID, fa.AmtSourceDr-fa.AmtSourceCr, fa.AmtAcctDr-fa.AmtAcctCr, "
|
||||
.append("SELECT i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created,i.CreatedBy, i.Updated,i.UpdatedBy,")
|
||||
.append( getAD_PInstance_ID()).append(", i.C_Invoice_ID, i.GrandTotal, invoiceOpen(i.C_Invoice_ID, 0), ")
|
||||
.append(" fa.Fact_Acct_ID, fa.AmtSourceDr-fa.AmtSourceCr, fa.AmtAcctDr-fa.AmtAcctCr, ")
|
||||
// AmtRevalDr, AmtRevalCr,
|
||||
+ " currencyConvert(fa.AmtSourceDr, i.C_Currency_ID, a.C_Currency_ID, " + dateStr + ", " + p_C_ConversionTypeReval_ID + ", i.AD_Client_ID, i.AD_Org_ID),"
|
||||
+ " currencyConvert(fa.AmtSourceCr, i.C_Currency_ID, a.C_Currency_ID, " + dateStr + ", " + p_C_ConversionTypeReval_ID + ", i.AD_Client_ID, i.AD_Org_ID),"
|
||||
+ (p_C_DocTypeReval_ID==0 ? "NULL" : String.valueOf(p_C_DocTypeReval_ID)) + ", "
|
||||
+ (p_IsAllCurrencies ? "'Y'," : "'N',")
|
||||
+ dateStr + ", " + p_C_ConversionTypeReval_ID + ", 0, 0, '" + p_APAR + "' "
|
||||
.append(" currencyConvert(fa.AmtSourceDr, i.C_Currency_ID, a.C_Currency_ID, ").append(dateStr).append(", ").append(p_C_ConversionTypeReval_ID).append(", i.AD_Client_ID, i.AD_Org_ID),")
|
||||
.append(" currencyConvert(fa.AmtSourceCr, i.C_Currency_ID, a.C_Currency_ID, ").append(dateStr).append(", ").append(p_C_ConversionTypeReval_ID).append(", i.AD_Client_ID, i.AD_Org_ID),")
|
||||
.append((p_C_DocTypeReval_ID==0 ? "NULL" : String.valueOf(p_C_DocTypeReval_ID))).append(", ")
|
||||
.append((p_IsAllCurrencies ? "'Y'," : "'N',"))
|
||||
.append(dateStr).append(", ").append(p_C_ConversionTypeReval_ID).append(", 0, 0, '").append(p_APAR).append("' ")
|
||||
//
|
||||
+ "FROM C_Invoice_v i"
|
||||
+ " INNER JOIN Fact_Acct fa ON (fa.AD_Table_ID=318 AND fa.Record_ID=i.C_Invoice_ID"
|
||||
+ " AND (i.GrandTotal=fa.AmtSourceDr OR i.GrandTotal=fa.AmtSourceCr))"
|
||||
+ " INNER JOIN C_AcctSchema a ON (fa.C_AcctSchema_ID=a.C_AcctSchema_ID) "
|
||||
+ "WHERE i.IsPaid='N'"
|
||||
+ " AND EXISTS (SELECT * FROM C_ElementValue ev "
|
||||
+ "WHERE ev.C_ElementValue_ID=fa.Account_ID AND (ev.AccountType='A' OR ev.AccountType='L'))"
|
||||
+ " AND fa.C_AcctSchema_ID=" + p_C_AcctSchema_ID;
|
||||
.append("FROM C_Invoice_v i")
|
||||
.append(" INNER JOIN Fact_Acct fa ON (fa.AD_Table_ID=318 AND fa.Record_ID=i.C_Invoice_ID")
|
||||
.append(" AND (i.GrandTotal=fa.AmtSourceDr OR i.GrandTotal=fa.AmtSourceCr))")
|
||||
.append(" INNER JOIN C_AcctSchema a ON (fa.C_AcctSchema_ID=a.C_AcctSchema_ID) ")
|
||||
.append("WHERE i.IsPaid='N'")
|
||||
.append(" AND EXISTS (SELECT * FROM C_ElementValue ev ")
|
||||
.append("WHERE ev.C_ElementValue_ID=fa.Account_ID AND (ev.AccountType='A' OR ev.AccountType='L'))")
|
||||
.append(" AND fa.C_AcctSchema_ID=").append(p_C_AcctSchema_ID);
|
||||
if (!p_IsAllCurrencies)
|
||||
sql += " AND i.C_Currency_ID<>a.C_Currency_ID";
|
||||
sql.append(" AND i.C_Currency_ID<>a.C_Currency_ID");
|
||||
if (ONLY_AR.equals(p_APAR))
|
||||
sql += " AND i.IsSOTrx='Y'";
|
||||
sql.append(" AND i.IsSOTrx='Y'");
|
||||
else if (ONLY_AP.equals(p_APAR))
|
||||
sql += " AND i.IsSOTrx='N'";
|
||||
sql.append(" AND i.IsSOTrx='N'");
|
||||
if (!p_IsAllCurrencies && p_C_Currency_ID != 0)
|
||||
sql += " AND i.C_Currency_ID=" + p_C_Currency_ID;
|
||||
sql.append(" AND i.C_Currency_ID=").append(p_C_Currency_ID);
|
||||
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no != 0)
|
||||
log.info("Inserted #" + no);
|
||||
else if (CLogMgt.isLevelFiner())
|
||||
|
@ -166,35 +166,35 @@ public class InvoiceNGL extends SvrProcess
|
|||
log.warning("Inserted #" + no);
|
||||
|
||||
// Calculate Difference
|
||||
sql = "UPDATE T_InvoiceGL gl "
|
||||
+ "SET (AmtRevalDrDiff,AmtRevalCrDiff)="
|
||||
+ "(SELECT gl.AmtRevalDr-fa.AmtAcctDr, gl.AmtRevalCr-fa.AmtAcctCr "
|
||||
+ "FROM Fact_Acct fa "
|
||||
+ "WHERE gl.Fact_Acct_ID=fa.Fact_Acct_ID) "
|
||||
+ "WHERE AD_PInstance_ID=" + getAD_PInstance_ID();
|
||||
int noT = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE T_InvoiceGL gl ")
|
||||
.append("SET (AmtRevalDrDiff,AmtRevalCrDiff)=")
|
||||
.append("(SELECT gl.AmtRevalDr-fa.AmtAcctDr, gl.AmtRevalCr-fa.AmtAcctCr ")
|
||||
.append("FROM Fact_Acct fa ")
|
||||
.append("WHERE gl.Fact_Acct_ID=fa.Fact_Acct_ID) ")
|
||||
.append("WHERE AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
int noT = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (noT > 0)
|
||||
log.config("Difference #" + noT);
|
||||
|
||||
// Percentage
|
||||
sql = "UPDATE T_InvoiceGL SET Percent = 100 "
|
||||
+ "WHERE GrandTotal=OpenAmt AND AD_PInstance_ID=" + getAD_PInstance_ID();
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE T_InvoiceGL SET Percent = 100 ")
|
||||
.append("WHERE GrandTotal=OpenAmt AND AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.info("Not Paid #" + no);
|
||||
|
||||
sql = "UPDATE T_InvoiceGL SET Percent = ROUND(OpenAmt*100/GrandTotal,6) "
|
||||
+ "WHERE GrandTotal<>OpenAmt AND GrandTotal <> 0 AND AD_PInstance_ID=" + getAD_PInstance_ID();
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE T_InvoiceGL SET Percent = ROUND(OpenAmt*100/GrandTotal,6) ")
|
||||
.append("WHERE GrandTotal<>OpenAmt AND GrandTotal <> 0 AND AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.info("Partial Paid #" + no);
|
||||
|
||||
sql = "UPDATE T_InvoiceGL SET AmtRevalDr = AmtRevalDr * Percent/100,"
|
||||
+ " AmtRevalCr = AmtRevalCr * Percent/100,"
|
||||
+ " AmtRevalDrDiff = AmtRevalDrDiff * Percent/100,"
|
||||
+ " AmtRevalCrDiff = AmtRevalCrDiff * Percent/100 "
|
||||
+ "WHERE Percent <> 100 AND AD_PInstance_ID=" + getAD_PInstance_ID();
|
||||
no = DB.executeUpdate(sql, get_TrxName());
|
||||
sql = new StringBuilder("UPDATE T_InvoiceGL SET AmtRevalDr = AmtRevalDr * Percent/100,")
|
||||
.append(" AmtRevalCr = AmtRevalCr * Percent/100,")
|
||||
.append(" AmtRevalDrDiff = AmtRevalDrDiff * Percent/100,")
|
||||
.append(" AmtRevalCrDiff = AmtRevalCrDiff * Percent/100 ")
|
||||
.append("WHERE Percent <> 100 AND AD_PInstance_ID=").append(getAD_PInstance_ID());
|
||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||
if (no > 0)
|
||||
log.config("Partial Calc #" + no);
|
||||
|
||||
|
@ -206,8 +206,9 @@ public class InvoiceNGL extends SvrProcess
|
|||
log.warning("Can create Journal only for all currencies");
|
||||
else
|
||||
info = createGLJournal();
|
||||
}
|
||||
return "#" + noT + info;
|
||||
}
|
||||
StringBuilder msgreturn = new StringBuilder("#").append(noT).append(info);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
@ -302,8 +303,9 @@ public class InvoiceNGL extends SvrProcess
|
|||
}
|
||||
}
|
||||
createBalancing (asDefaultAccts, journal, drTotal, crTotal, AD_Org_ID, (list.size()+1) * 10);
|
||||
|
||||
return " - " + batch.getDocumentNo() + " #" + list.size();
|
||||
|
||||
StringBuilder msgreturn = new StringBuilder(" - ").append(batch.getDocumentNo()).append(" #").append(list.size());
|
||||
return msgreturn.toString();
|
||||
} // createGLJournal
|
||||
|
||||
/**
|
||||
|
|
|
@ -84,12 +84,12 @@ public class InvoicePayScheduleValidate extends SvrProcess
|
|||
schedule[i].saveEx();
|
||||
}
|
||||
}
|
||||
String msg = "@OK@";
|
||||
StringBuilder msg = new StringBuilder("@OK@");
|
||||
if (!valid)
|
||||
msg = "@GrandTotal@ = " + invoice.getGrandTotal()
|
||||
+ " <> @Total@ = " + total
|
||||
+ " - @Difference@ = " + invoice.getGrandTotal().subtract(total);
|
||||
return Msg.parseTranslation(getCtx(), msg);
|
||||
msg = new StringBuilder("@GrandTotal@ = ").append(invoice.getGrandTotal())
|
||||
.append(" <> @Total@ = ").append(total)
|
||||
.append(" - @Difference@ = ").append(invoice.getGrandTotal().subtract(total));
|
||||
return Msg.parseTranslation(getCtx(), msg.toString());
|
||||
} // doIt
|
||||
|
||||
} // InvoicePayScheduleValidate
|
||||
|
|
|
@ -130,21 +130,20 @@ public class InvoicePrint extends SvrProcess
|
|||
MClient client = MClient.get(getCtx());
|
||||
|
||||
// Get Info
|
||||
StringBuffer sql = new StringBuffer (
|
||||
"SELECT i.C_Invoice_ID,bp.AD_Language,c.IsMultiLingualDocument," // 1..3
|
||||
StringBuilder sql = new StringBuilder ("SELECT i.C_Invoice_ID,bp.AD_Language,c.IsMultiLingualDocument,") // 1..3
|
||||
// Prio: 1. BPartner 2. DocType, 3. PrintFormat (Org) // see ReportCtl+MInvoice
|
||||
+ " COALESCE(bp.Invoice_PrintFormat_ID, dt.AD_PrintFormat_ID, pf.Invoice_PrintFormat_ID)," // 4
|
||||
+ " dt.DocumentCopies+bp.DocumentCopies," // 5
|
||||
+ " bpc.AD_User_ID, i.DocumentNo," // 6..7
|
||||
+ " bp.C_BPartner_ID " // 8
|
||||
+ "FROM C_Invoice i"
|
||||
+ " INNER JOIN C_BPartner bp ON (i.C_BPartner_ID=bp.C_BPartner_ID)"
|
||||
+ " LEFT OUTER JOIN AD_User bpc ON (i.AD_User_ID=bpc.AD_User_ID)"
|
||||
+ " INNER JOIN AD_Client c ON (i.AD_Client_ID=c.AD_Client_ID)"
|
||||
+ " INNER JOIN AD_PrintForm pf ON (i.AD_Client_ID=pf.AD_Client_ID)"
|
||||
+ " INNER JOIN C_DocType dt ON (i.C_DocType_ID=dt.C_DocType_ID)"
|
||||
+ " WHERE i.AD_Client_ID=? AND i.AD_Org_ID=? AND i.isSOTrx='Y' AND "
|
||||
+ " pf.AD_Org_ID IN (0,i.AD_Org_ID) AND " ); // more them 1 PF
|
||||
.append(" COALESCE(bp.Invoice_PrintFormat_ID, dt.AD_PrintFormat_ID, pf.Invoice_PrintFormat_ID),") // 4
|
||||
.append(" dt.DocumentCopies+bp.DocumentCopies,") // 5
|
||||
.append(" bpc.AD_User_ID, i.DocumentNo,") // 6..7
|
||||
.append(" bp.C_BPartner_ID ") // 8
|
||||
.append("FROM C_Invoice i")
|
||||
.append(" INNER JOIN C_BPartner bp ON (i.C_BPartner_ID=bp.C_BPartner_ID)")
|
||||
.append(" LEFT OUTER JOIN AD_User bpc ON (i.AD_User_ID=bpc.AD_User_ID)")
|
||||
.append(" INNER JOIN AD_Client c ON (i.AD_Client_ID=c.AD_Client_ID)")
|
||||
.append(" INNER JOIN AD_PrintForm pf ON (i.AD_Client_ID=pf.AD_Client_ID)")
|
||||
.append(" INNER JOIN C_DocType dt ON (i.C_DocType_ID=dt.C_DocType_ID)")
|
||||
.append(" WHERE i.AD_Client_ID=? AND i.AD_Org_ID=? AND i.isSOTrx='Y' AND ")
|
||||
.append(" pf.AD_Org_ID IN (0,i.AD_Org_ID) AND " ); // more them 1 PF
|
||||
boolean needAnd = false;
|
||||
if (m_C_Invoice_ID != 0)
|
||||
sql.append("i.C_Invoice_ID=").append(m_C_Invoice_ID);
|
||||
|
@ -289,8 +288,8 @@ public class InvoicePrint extends SvrProcess
|
|||
boolean printed = false;
|
||||
if (p_EMailPDF)
|
||||
{
|
||||
String subject = mText.getMailHeader() + " - " + DocumentNo;
|
||||
EMail email = client.createEMail(to.getEMail(), subject, null);
|
||||
StringBuilder subject =new StringBuilder(mText.getMailHeader()).append(" - ").append(DocumentNo);
|
||||
EMail email = client.createEMail(to.getEMail(), subject.toString(), null);
|
||||
if (!email.isValid())
|
||||
{
|
||||
addLog (C_Invoice_ID, null, null,
|
||||
|
@ -303,10 +302,10 @@ public class InvoicePrint extends SvrProcess
|
|||
mText.setPO(new MInvoice(getCtx(), C_Invoice_ID, get_TrxName()));
|
||||
String message = mText.getMailText(true);
|
||||
if (mText.isHtml())
|
||||
email.setMessageHTML(subject, message);
|
||||
email.setMessageHTML(subject.toString(), message);
|
||||
else
|
||||
{
|
||||
email.setSubject (subject);
|
||||
email.setSubject (subject.toString());
|
||||
email.setMessageText (message);
|
||||
}
|
||||
//
|
||||
|
@ -348,8 +347,8 @@ public class InvoicePrint extends SvrProcess
|
|||
// Print Confirm
|
||||
if (printed)
|
||||
{
|
||||
StringBuffer sb = new StringBuffer ("UPDATE C_Invoice "
|
||||
+ "SET DatePrinted=SysDate, IsPrinted='Y' WHERE C_Invoice_ID=")
|
||||
StringBuilder sb = new StringBuilder ("UPDATE C_Invoice ")
|
||||
.append("SET DatePrinted=SysDate, IsPrinted='Y' WHERE C_Invoice_ID=")
|
||||
.append (C_Invoice_ID);
|
||||
int no = DB.executeUpdate(sb.toString(), get_TrxName());
|
||||
}
|
||||
|
@ -364,9 +363,12 @@ public class InvoicePrint extends SvrProcess
|
|||
DB.close(rs, pstmt);
|
||||
}
|
||||
//
|
||||
if (p_EMailPDF)
|
||||
return "@Sent@=" + count + " - @Errors@=" + errors;
|
||||
return "@Printed@=" + count;
|
||||
if (p_EMailPDF){
|
||||
StringBuilder msgreturn = new StringBuilder("@Sent@=").append(count).append(" - @Errors@=").append(errors);
|
||||
return msgreturn.toString();
|
||||
}
|
||||
StringBuilder msgreturn = new StringBuilder("@Printed@=").append(count);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
} // InvoicePrint
|
||||
|
|
|
@ -134,10 +134,10 @@ public class InvoiceWriteOff extends SvrProcess
|
|||
if (p_CreatePayment && p_C_BankAccount_ID == 0)
|
||||
throw new AdempiereUserError ("@FillMandatory@ @C_BankAccount_ID@");
|
||||
//
|
||||
StringBuffer sql = new StringBuffer(
|
||||
"SELECT C_Invoice_ID,DocumentNo,DateInvoiced,"
|
||||
+ " C_Currency_ID,GrandTotal, invoiceOpen(C_Invoice_ID, 0) AS OpenAmt "
|
||||
+ "FROM C_Invoice WHERE ");
|
||||
StringBuilder sql = new StringBuilder(
|
||||
"SELECT C_Invoice_ID,DocumentNo,DateInvoiced,")
|
||||
.append(" C_Currency_ID,GrandTotal, invoiceOpen(C_Invoice_ID, 0) AS OpenAmt ")
|
||||
.append("FROM C_Invoice WHERE ");
|
||||
if (p_C_Invoice_ID != 0)
|
||||
sql.append("C_Invoice_ID=").append(p_C_Invoice_ID);
|
||||
else
|
||||
|
@ -201,7 +201,8 @@ public class InvoiceWriteOff extends SvrProcess
|
|||
// final
|
||||
processPayment();
|
||||
processAllocation();
|
||||
return "#" + counter;
|
||||
StringBuilder msgreturn = new StringBuilder("#").append(counter);
|
||||
return msgreturn.toString();
|
||||
} // doIt
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,14 +51,18 @@ public class IssueReport extends SvrProcess
|
|||
return "NOT reported - Enable Error Reporting in Window System";
|
||||
//
|
||||
MIssue issue = new MIssue(getCtx(), m_AD_Issue_ID, get_TrxName());
|
||||
if (issue.get_ID() == 0)
|
||||
return "No Issue to report - ID=" + m_AD_Issue_ID;
|
||||
if (issue.get_ID() == 0){
|
||||
StringBuilder msgreturn = new StringBuilder("No Issue to report - ID=").append(m_AD_Issue_ID);
|
||||
return msgreturn.toString();
|
||||
}
|
||||
//
|
||||
String error = issue.report();
|
||||
if (error != null)
|
||||
throw new AdempiereSystemError(error);
|
||||
if (issue.save())
|
||||
return "Issue Reported: " + issue.getRequestDocumentNo();
|
||||
if (issue.save()){
|
||||
StringBuilder msgreturn = new StringBuilder("Issue Reported: ").append(issue.getRequestDocumentNo());
|
||||
return msgreturn.toString();
|
||||
}
|
||||
throw new AdempiereSystemError("Issue Not Saved");
|
||||
} // doIt
|
||||
|
||||
|
|
|
@ -79,10 +79,10 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
*/
|
||||
|
||||
protected String doIt() throws Exception {
|
||||
String sql;
|
||||
String sqlupd;
|
||||
String sqldel;
|
||||
String sqlins;
|
||||
StringBuilder sql = new StringBuilder();
|
||||
StringBuilder sqlupd = new StringBuilder();
|
||||
StringBuilder sqldel = new StringBuilder();
|
||||
StringBuilder sqlins = new StringBuilder();
|
||||
int cntu = 0;
|
||||
int cntd = 0;
|
||||
int cnti = 0;
|
||||
|
@ -91,67 +91,66 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
int totd = 0;
|
||||
int V_temp;
|
||||
int v_NextNo = 0;
|
||||
String Message = " ";
|
||||
StringBuilder Message = new StringBuilder();
|
||||
//
|
||||
//Checking Prerequisites
|
||||
//PO Prices must exists
|
||||
//
|
||||
sqlupd = "UPDATE M_Product_PO " + " SET PriceList = 0 "
|
||||
+ " WHERE PriceList IS NULL ";
|
||||
sqlupd.append("UPDATE M_Product_PO SET PriceList = 0 ")
|
||||
.append(" WHERE PriceList IS NULL ");
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd, get_TrxName());
|
||||
cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName());
|
||||
if (cntu == -1)
|
||||
raiseError(
|
||||
"Update The PriceList to zero of M_Product_PO WHERE PriceList IS NULL",
|
||||
sqlupd);
|
||||
sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
|
||||
sqlupd = "UPDATE M_Product_PO " + " SET PriceLastPO = 0 "
|
||||
+ " WHERE PriceLastPO IS NULL ";
|
||||
sqlupd = new StringBuilder("UPDATE M_Product_PO SET PriceLastPO = 0 ");
|
||||
sqlupd.append(" WHERE PriceLastPO IS NULL ");
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd, get_TrxName());
|
||||
cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName());
|
||||
if (cntu == -1)
|
||||
raiseError(
|
||||
"Update The PriceListPO to zero of M_Product_PO WHERE PriceLastPO IS NULL",
|
||||
sqlupd);
|
||||
sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
|
||||
sqlupd = "UPDATE M_Product_PO "
|
||||
+ " SET PricePO = PriceLastPO "
|
||||
+ " WHERE (PricePO IS NULL OR PricePO = 0) AND PriceLastPO <> 0 ";
|
||||
sqlupd = new StringBuilder("UPDATE M_Product_PO SET PricePO = PriceLastPO ");
|
||||
sqlupd.append(" WHERE (PricePO IS NULL OR PricePO = 0) AND PriceLastPO <> 0 ");
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd, get_TrxName());
|
||||
cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName());
|
||||
if (cntu == -1)
|
||||
raiseError(
|
||||
"Update The PricePO to PriceLastPO of M_Product_PO WHERE (PricePO IS NULL OR PricePO = 0) AND PriceLastPO <> 0 ",
|
||||
sqlupd);
|
||||
sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
|
||||
sqlupd = "UPDATE M_Product_PO " + " SET PricePO = 0 "
|
||||
+ " WHERE PricePO IS NULL ";
|
||||
sqlupd = new StringBuilder("UPDATE M_Product_PO SET PricePO = 0 ");
|
||||
sqlupd.append(" WHERE PricePO IS NULL ");
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd, get_TrxName());
|
||||
cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName());
|
||||
if (cntu == -1)
|
||||
raiseError(
|
||||
"Update The PricePO to Zero of M_Product_PO WHERE PricePO IS NULL",
|
||||
sqlupd);
|
||||
sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
//
|
||||
// Set default current vendor
|
||||
//
|
||||
sqlupd = "UPDATE M_Product_PO " + " SET IsCurrentVendor = 'Y' "
|
||||
+ " WHERE IsCurrentVendor = 'N' " + " AND NOT EXISTS "
|
||||
+ " (SELECT pp.M_Product_ID " + " FROM M_Product_PO pp "
|
||||
+ " WHERE pp.M_Product_ID = M_Product_PO.M_Product_ID"
|
||||
+ " GROUP BY pp.M_Product_ID HAVING COUNT(*) > 1) ";
|
||||
sqlupd = new StringBuilder("UPDATE M_Product_PO SET IsCurrentVendor = 'Y' ");
|
||||
sqlupd.append(" WHERE IsCurrentVendor = 'N' AND NOT EXISTS ");
|
||||
sqlupd.append(" (SELECT pp.M_Product_ID FROM M_Product_PO pp ");
|
||||
sqlupd.append(" WHERE pp.M_Product_ID = M_Product_PO.M_Product_ID");
|
||||
sqlupd.append(" GROUP BY pp.M_Product_ID HAVING COUNT(*) > 1) ");
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd, get_TrxName());
|
||||
cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName());
|
||||
if (cntu == -1)
|
||||
raiseError("Update IsCurrentVendor to Y of M_Product_PO ", sqlupd);
|
||||
raiseError("Update IsCurrentVendor to Y of M_Product_PO ", sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
|
||||
|
@ -161,26 +160,26 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
//
|
||||
// Make sure that we have only one active product
|
||||
//
|
||||
sql = "SELECT DISTINCT M_Product_ID FROM M_Product_PO po "
|
||||
+ " WHERE IsCurrentVendor='Y' AND IsActive='Y' "
|
||||
+ " AND EXISTS (SELECT M_Product_ID "
|
||||
+ " FROM M_Product_PO x "
|
||||
+ " WHERE x.M_Product_ID=po.M_Product_ID "
|
||||
+ " AND IsCurrentVendor='Y' AND IsActive='Y' "
|
||||
+ " GROUP BY M_Product_ID " + " HAVING COUNT(*) > 1 ) ";
|
||||
sql.append("SELECT DISTINCT M_Product_ID FROM M_Product_PO po ");
|
||||
sql.append(" WHERE IsCurrentVendor='Y' AND IsActive='Y' ");
|
||||
sql.append(" AND EXISTS (SELECT M_Product_ID ");
|
||||
sql.append(" FROM M_Product_PO x ");
|
||||
sql.append(" WHERE x.M_Product_ID=po.M_Product_ID ");
|
||||
sql.append(" AND IsCurrentVendor='Y' AND IsActive='Y' ");
|
||||
sql.append(" GROUP BY M_Product_ID ").append(" HAVING COUNT(*) > 1 ) ");
|
||||
|
||||
PreparedStatement Cur_Duplicates = null;
|
||||
Cur_Duplicates = DB.prepareStatement(sql, get_TrxName());
|
||||
Cur_Duplicates = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
ResultSet dupl = Cur_Duplicates.executeQuery();
|
||||
while (dupl.next()) {
|
||||
sql = "SELECT M_Product_ID " + " ,C_BPartner_ID "
|
||||
+ " FROM M_Product_PO " + " WHERE IsCurrentVendor = 'Y' "
|
||||
+ " AND IsActive = 'Y' "
|
||||
+ " AND M_Product_ID = " + dupl.getInt("M_Product_ID")
|
||||
+ " ORDER BY PriceList DESC";
|
||||
sql = new StringBuilder("SELECT M_Product_ID ,C_BPartner_ID ");
|
||||
sql.append(" FROM M_Product_PO WHERE IsCurrentVendor = 'Y' ");
|
||||
sql.append(" AND IsActive = 'Y' ");
|
||||
sql.append(" AND M_Product_ID = ").append(dupl.getInt("M_Product_ID"));
|
||||
sql.append(" ORDER BY PriceList DESC");
|
||||
|
||||
PreparedStatement Cur_Vendors = null;
|
||||
Cur_Vendors = DB.prepareStatement(sql, get_TrxName());
|
||||
Cur_Vendors = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
ResultSet Vend = Cur_Vendors.executeQuery();
|
||||
|
||||
//
|
||||
|
@ -189,17 +188,17 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
Vend.next();
|
||||
|
||||
while (Vend.next()) {
|
||||
sqlupd = "UPDATE M_Product_PO "
|
||||
+ " SET IsCurrentVendor = 'N' "
|
||||
+ " WHERE M_Product_ID= " + Vend.getInt("M_Product_ID")
|
||||
+ " AND C_BPartner_ID= "
|
||||
+ Vend.getInt("C_BPartner_ID");
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd, get_TrxName());
|
||||
sqlupd = new StringBuilder("UPDATE M_Product_PO ");
|
||||
sqlupd.append(" SET IsCurrentVendor = 'N' ");
|
||||
sqlupd.append(" WHERE M_Product_ID= ").append(Vend.getInt("M_Product_ID"));
|
||||
sqlupd.append(" AND C_BPartner_ID= ");
|
||||
sqlupd.append(Vend.getInt("C_BPartner_ID"));
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName());
|
||||
if (cntu == -1)
|
||||
raiseError(
|
||||
"Update IsCurrentVendor to N of M_Product_PO for a M_Product_ID and C_BPartner_ID ingresed",
|
||||
sqlupd);
|
||||
sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
|
||||
|
@ -219,56 +218,60 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
// Delete Old Data
|
||||
//
|
||||
if (p_DeleteOld.equals("Y")) {
|
||||
sqldel = "DELETE M_ProductPrice "
|
||||
+ " WHERE M_PriceList_Version_ID = "
|
||||
+ p_PriceList_Version_ID;
|
||||
cntd = DB.executeUpdate(sqldel, get_TrxName());
|
||||
sqldel.append("DELETE M_ProductPrice ")
|
||||
.append(" WHERE M_PriceList_Version_ID = ")
|
||||
.append(p_PriceList_Version_ID);
|
||||
cntd = DB.executeUpdate(sqldel.toString(), get_TrxName());
|
||||
if (cntd == -1)
|
||||
raiseError(" DELETE M_ProductPrice ", sqldel);
|
||||
raiseError(" DELETE M_ProductPrice ", sqldel.toString());
|
||||
totd += cntd;
|
||||
Message = "@Deleted@=" + cntd + " - ";
|
||||
Message = new StringBuilder("@Deleted@=").append(cntd).append(" - ");
|
||||
log.fine("Deleted " + cntd);
|
||||
}
|
||||
//
|
||||
// Get PriceList Info
|
||||
//
|
||||
sql = "SELECT p.C_Currency_ID " + " , c.StdPrecision "
|
||||
+ " , v.AD_Client_ID " + " , v.AD_Org_ID " + " , v.UpdatedBy "
|
||||
+ " , v.M_DiscountSchema_ID "
|
||||
+ " , M_PriceList_Version_Base_ID " + " FROM M_PriceList p "
|
||||
+ " ,M_PriceList_Version v " + " ,C_Currency c "
|
||||
+ " WHERE p.M_PriceList_ID = v.M_PriceList_ID "
|
||||
+ " AND p.C_Currency_ID = c.C_Currency_ID"
|
||||
+ " AND v.M_PriceList_Version_ID = " + p_PriceList_Version_ID;
|
||||
sql = new StringBuilder("SELECT p.C_Currency_ID , c.StdPrecision ");
|
||||
sql.append(" , v.AD_Client_ID , v.AD_Org_ID , v.UpdatedBy ");
|
||||
sql.append(" , v.M_DiscountSchema_ID ");
|
||||
sql.append(" , M_PriceList_Version_Base_ID FROM M_PriceList p ");
|
||||
sql.append(" ,M_PriceList_Version v ,C_Currency c ");
|
||||
sql.append(" WHERE p.M_PriceList_ID = v.M_PriceList_ID ");
|
||||
sql.append(" AND p.C_Currency_ID = c.C_Currency_ID");
|
||||
sql.append(" AND v.M_PriceList_Version_ID = ").append(p_PriceList_Version_ID);
|
||||
|
||||
PreparedStatement curgen = null;
|
||||
curgen = DB.prepareStatement(sql, get_TrxName());
|
||||
curgen = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
ResultSet v = curgen.executeQuery();
|
||||
while (v.next()) {
|
||||
//
|
||||
// For All Discount Lines in Sequence
|
||||
//
|
||||
sql = "SELECT m_discountschemaline_id"
|
||||
+ ",ad_client_id,ad_org_id,isactive,created,createdby,updated,updatedby"
|
||||
+ ",m_discountschema_id,seqno,m_product_category_id,c_bpartner_id,m_product_id"
|
||||
+ ",conversiondate,list_base,list_addamt,list_discount,list_rounding,list_minamt"
|
||||
+ ",list_maxamt,list_fixed,std_base,std_addamt,std_discount,std_rounding"
|
||||
+ ",std_minamt,std_maxamt,std_fixed,limit_base,limit_addamt,limit_discount"
|
||||
+ ",limit_rounding,limit_minamt,limit_maxamt,limit_fixed,group1,group2,c_conversiontype_id"
|
||||
+ " FROM M_DiscountSchemaLine"
|
||||
+ " WHERE M_DiscountSchema_ID="
|
||||
+ v.getInt("M_DiscountSchema_ID")
|
||||
+ " AND IsActive='Y' ORDER BY SeqNo";
|
||||
sql = new StringBuilder("SELECT m_discountschemaline_id");
|
||||
sql.append(",ad_client_id,ad_org_id,isactive,created,createdby,updated,updatedby");
|
||||
sql.append(",m_discountschema_id,seqno,m_product_category_id,c_bpartner_id,m_product_id");
|
||||
sql.append(",conversiondate,list_base,list_addamt,list_discount,list_rounding,list_minamt");
|
||||
sql.append(",list_maxamt,list_fixed,std_base,std_addamt,std_discount,std_rounding");
|
||||
sql.append(",std_minamt,std_maxamt,std_fixed,limit_base,limit_addamt,limit_discount");
|
||||
sql.append(",limit_rounding,limit_minamt,limit_maxamt,limit_fixed,group1,group2,c_conversiontype_id");
|
||||
sql.append(" FROM M_DiscountSchemaLine");
|
||||
sql.append(" WHERE M_DiscountSchema_ID=");
|
||||
sql.append(v.getInt("M_DiscountSchema_ID"));
|
||||
sql.append(" AND IsActive='Y' ORDER BY SeqNo");
|
||||
|
||||
PreparedStatement Cur_DiscountLine = null;
|
||||
Cur_DiscountLine = DB.prepareStatement(sql, get_TrxName());
|
||||
Cur_DiscountLine = DB.prepareStatement(sql.toString(), get_TrxName());
|
||||
ResultSet dl = Cur_DiscountLine.executeQuery();
|
||||
while (dl.next()) {
|
||||
//
|
||||
//Clear Temporary Table
|
||||
//
|
||||
sqldel = "DELETE FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID;
|
||||
cntd = DB.executeUpdate(sqldel, get_TrxName());
|
||||
sqldel = new StringBuilder("DELETE FROM T_Selection WHERE AD_PInstance_ID=");
|
||||
sqldel.append(m_AD_PInstance_ID);
|
||||
|
||||
cntd = DB.executeUpdate(sqldel.toString(), get_TrxName());
|
||||
if (cntd == -1)
|
||||
raiseError(" DELETE T_Selection ", sqldel);
|
||||
raiseError(" DELETE T_Selection ", sqldel.toString());
|
||||
totd += cntd;
|
||||
log.fine("Deleted " + cntd);
|
||||
//
|
||||
|
@ -281,29 +284,30 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
//
|
||||
//Create Selection from M_Product_PO
|
||||
//
|
||||
sqlins = "INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) "
|
||||
+ " SELECT DISTINCT " + m_AD_PInstance_ID +", po.M_Product_ID "
|
||||
+ " FROM M_Product p, M_Product_PO po"
|
||||
+ " WHERE p.M_Product_ID=po.M_Product_ID "
|
||||
+ " AND (p.AD_Client_ID=" + v.getInt("AD_Client_ID") + " OR p.AD_Client_ID=0)"
|
||||
+ " AND p.IsActive='Y' AND po.IsActive='Y' AND po.IsCurrentVendor='Y' "
|
||||
sqlins.append("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) ");
|
||||
sqlins.append( " SELECT DISTINCT ").append(m_AD_PInstance_ID).append(", po.M_Product_ID ");
|
||||
sqlins.append(" FROM M_Product p, M_Product_PO po");
|
||||
sqlins.append(" WHERE p.M_Product_ID=po.M_Product_ID ");
|
||||
sqlins.append(" AND (p.AD_Client_ID=").append(v.getInt("AD_Client_ID")).append(" OR p.AD_Client_ID=0)");
|
||||
sqlins.append(" AND p.IsActive='Y' AND po.IsActive='Y' AND po.IsCurrentVendor='Y' ");
|
||||
//
|
||||
//Optional Restrictions
|
||||
//
|
||||
// globalqss - detected bug, JDBC returns zero for null values
|
||||
// so we're going to use NULLIF(value, 0)
|
||||
+ " AND (NULLIF(" + dl.getInt("M_Product_Category_ID") + ",0) IS NULL"
|
||||
+ " OR p.M_Product_Category_ID IN (" + getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")) + "))";
|
||||
sqlins.append(" AND (NULLIF(").append(dl.getInt("M_Product_Category_ID")).append(",0) IS NULL");
|
||||
sqlins.append(" OR p.M_Product_Category_ID IN (").append(getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")))
|
||||
.append("))");
|
||||
if(dl_Group1 != null)
|
||||
sqlins = sqlins + " AND (p.Group1=?)";
|
||||
sqlins.append(" AND (p.Group1=?)");
|
||||
if (dl_Group2 != null)
|
||||
sqlins = sqlins + " AND (p.Group2=?)";
|
||||
sqlins = sqlins + " AND (NULLIF(" + dl.getInt("C_BPartner_ID") + ",0) IS NULL "
|
||||
+ " OR po.C_BPartner_ID=" + dl.getInt("C_BPartner_ID") + ")"
|
||||
+ " AND (NULLIF(" + dl.getInt("M_Product_ID") + ",0) IS NULL "
|
||||
+ " OR p.M_Product_ID=" + dl.getInt("M_Product_ID") + ")";
|
||||
sqlins.append(" AND (p.Group2=?)");
|
||||
sqlins.append(" AND (NULLIF(").append(dl.getInt("C_BPartner_ID")).append(",0) IS NULL ");
|
||||
sqlins.append(" OR po.C_BPartner_ID=").append(dl.getInt("C_BPartner_ID")).append(")");
|
||||
sqlins.append(" AND (NULLIF(").append(dl.getInt("M_Product_ID")).append(",0) IS NULL ");
|
||||
sqlins.append(" OR p.M_Product_ID=").append(dl.getInt("M_Product_ID")).append(")");
|
||||
|
||||
CPreparedStatement stmt = DB.prepareStatement(sqlins, get_TrxName());
|
||||
CPreparedStatement stmt = DB.prepareStatement(sqlins.toString(), get_TrxName());
|
||||
|
||||
int i = 1;
|
||||
|
||||
|
@ -315,7 +319,7 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
cnti = stmt.executeUpdate();
|
||||
|
||||
if (cnti == -1)
|
||||
raiseError(" INSERT INTO T_Selection ", sqlins);
|
||||
raiseError(" INSERT INTO T_Selection ", sqlins.toString());
|
||||
toti += cnti;
|
||||
log.fine("Inserted " + cnti);
|
||||
|
||||
|
@ -323,36 +327,37 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
//
|
||||
// Create Selection from existing PriceList
|
||||
//
|
||||
sqlins = "INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID)"
|
||||
+ " SELECT DISTINCT " + m_AD_PInstance_ID +", p.M_Product_ID"
|
||||
+ " FROM M_Product p, M_ProductPrice pp"
|
||||
+ " WHERE p.M_Product_ID=pp.M_Product_ID"
|
||||
+ " AND pp.M_PriceList_Version_ID = " + v.getInt("M_PriceList_Version_Base_ID")
|
||||
+ " AND p.IsActive='Y' AND pp.IsActive='Y'"
|
||||
sqlins = new StringBuilder("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID)");
|
||||
sqlins.append(" SELECT DISTINCT ").append(m_AD_PInstance_ID).append(", p.M_Product_ID");
|
||||
sqlins.append(" FROM M_Product p, M_ProductPrice pp");
|
||||
sqlins.append(" WHERE p.M_Product_ID=pp.M_Product_ID");
|
||||
sqlins.append(" AND pp.M_PriceList_Version_ID = ").append(v.getInt("M_PriceList_Version_Base_ID"));
|
||||
sqlins.append(" AND p.IsActive='Y' AND pp.IsActive='Y'");
|
||||
//
|
||||
//Optional Restrictions
|
||||
//
|
||||
+ " AND (NULLIF(" + dl.getInt("M_Product_Category_ID") + ",0) IS NULL"
|
||||
+ " OR p.M_Product_Category_ID IN (" + getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")) + "))";
|
||||
sqlins.append(" AND (NULLIF(").append(dl.getInt("M_Product_Category_ID")).append(",0) IS NULL");
|
||||
sqlins.append(" OR p.M_Product_Category_ID IN (").append(getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")))
|
||||
.append("))");
|
||||
if(dl_Group1 != null)
|
||||
sqlins = sqlins + " AND (p.Group1=?)";
|
||||
sqlins.append(" AND (p.Group1=?)");
|
||||
if (dl_Group2 != null)
|
||||
sqlins = sqlins + " AND (p.Group2=?)";
|
||||
sqlins = sqlins + " AND (NULLIF(" + dl.getInt("C_BPartner_ID") + ",0) IS NULL OR EXISTS "
|
||||
+ "(SELECT m_product_id,c_bpartner_id,ad_client_id,ad_org_id,isactive"
|
||||
+ ",created,createdby,updated,updatedby,iscurrentvendor,c_uom_id"
|
||||
+ ",c_currency_id,pricelist,pricepo,priceeffective,pricelastpo"
|
||||
+ ",pricelastinv,vendorproductno,upc,vendorcategory,discontinued"
|
||||
+ ",discontinuedby,order_min,order_pack,costperorder"
|
||||
+ ",deliverytime_promised,deliverytime_actual,qualityrating"
|
||||
+ ",royaltyamt,group1,group2"
|
||||
+ ",manufacturer FROM M_Product_PO po WHERE po.M_Product_ID=p.M_Product_ID"
|
||||
+ " AND po.C_BPartner_ID=" + dl.getInt("C_BPartner_ID") + "))"
|
||||
+ " AND (NULLIF(" + dl.getInt("M_Product_ID") + ",0) IS NULL "
|
||||
+ " OR p.M_Product_ID=" + dl.getInt("M_Product_ID") + ")";
|
||||
sqlins.append(" AND (p.Group2=?)");
|
||||
sqlins.append(" AND (NULLIF(").append(dl.getInt("C_BPartner_ID")).append(",0) IS NULL OR EXISTS ");
|
||||
sqlins.append("(SELECT m_product_id,c_bpartner_id,ad_client_id,ad_org_id,isactive");
|
||||
sqlins.append(",created,createdby,updated,updatedby,iscurrentvendor,c_uom_id");
|
||||
sqlins.append(",c_currency_id,pricelist,pricepo,priceeffective,pricelastpo");
|
||||
sqlins.append(",pricelastinv,vendorproductno,upc,vendorcategory,discontinued");
|
||||
sqlins.append(",discontinuedby,order_min,order_pack,costperorder");
|
||||
sqlins.append(",deliverytime_promised,deliverytime_actual,qualityrating");
|
||||
sqlins.append(",royaltyamt,group1,group2");
|
||||
sqlins.append(",manufacturer FROM M_Product_PO po WHERE po.M_Product_ID=p.M_Product_ID");
|
||||
sqlins.append(" AND po.C_BPartner_ID=").append(dl.getInt("C_BPartner_ID")).append("))");
|
||||
sqlins.append(" AND (NULLIF(").append(dl.getInt("M_Product_ID")).append(",0) IS NULL ");
|
||||
sqlins.append(" OR p.M_Product_ID=").append(dl.getInt("M_Product_ID")).append(")");
|
||||
|
||||
|
||||
CPreparedStatement stmt = DB.prepareStatement(sqlins, get_TrxName());
|
||||
CPreparedStatement stmt = DB.prepareStatement(sqlins.toString(), get_TrxName());
|
||||
int i = 1;
|
||||
|
||||
if (dl_Group1!=null)
|
||||
|
@ -364,13 +369,13 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
if (cnti == -1)
|
||||
raiseError(
|
||||
" INSERT INTO T_Selection from existing PriceList",
|
||||
sqlins);
|
||||
sqlins.toString());
|
||||
toti += cnti;
|
||||
log.fine("Inserted " + cnti);
|
||||
|
||||
}
|
||||
|
||||
Message = Message + "@Selected@=" + cnti;
|
||||
Message.append("@Selected@=").append(cnti);
|
||||
|
||||
//
|
||||
//Delete Prices in Selection, so that we can insert
|
||||
|
@ -378,17 +383,17 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
V_temp = v.getInt("M_PriceList_Version_Base_ID");
|
||||
if (v.wasNull() || V_temp != p_PriceList_Version_ID) {
|
||||
|
||||
sqldel = "DELETE M_ProductPrice pp"
|
||||
+ " WHERE pp.M_PriceList_Version_ID = "
|
||||
+ p_PriceList_Version_ID
|
||||
+ " AND EXISTS (SELECT t_selection_id FROM T_Selection s WHERE pp.M_Product_ID=s.T_Selection_ID"
|
||||
+ " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")";
|
||||
sqldel = new StringBuilder("DELETE M_ProductPrice pp");
|
||||
sqldel.append(" WHERE pp.M_PriceList_Version_ID = ");
|
||||
sqldel.append(p_PriceList_Version_ID);
|
||||
sqldel.append(" AND EXISTS (SELECT t_selection_id FROM T_Selection s WHERE pp.M_Product_ID=s.T_Selection_ID");
|
||||
sqldel.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")");
|
||||
|
||||
cntd = DB.executeUpdate(sqldel, get_TrxName());
|
||||
cntd = DB.executeUpdate(sqldel.toString(), get_TrxName());
|
||||
if (cntd == -1)
|
||||
raiseError(" DELETE M_ProductPrice ", sqldel);
|
||||
raiseError(" DELETE M_ProductPrice ", sqldel.toString());
|
||||
totd += cntd;
|
||||
Message = Message + ", @Deleted@=" + cntd;
|
||||
Message.append(", @Deleted@=").append(cntd);
|
||||
log.fine("Deleted " + cntd);
|
||||
}
|
||||
|
||||
|
@ -406,71 +411,71 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
//Copy and Convert from Product_PO
|
||||
//
|
||||
{
|
||||
sqlins = "INSERT INTO M_ProductPrice "
|
||||
+ "(M_PriceList_Version_ID"
|
||||
+ " ,M_Product_ID "
|
||||
+ " ,AD_Client_ID"
|
||||
+ " , AD_Org_ID"
|
||||
+ " , IsActive"
|
||||
+ " , Created"
|
||||
+ " , CreatedBy"
|
||||
+ " , Updated"
|
||||
+ " , UpdatedBy"
|
||||
+ " , PriceList"
|
||||
+ " , PriceStd"
|
||||
+ " , PriceLimit) "
|
||||
+ "SELECT "
|
||||
+ p_PriceList_Version_ID
|
||||
+ " ,po.M_Product_ID "
|
||||
+ " ,"
|
||||
+ v.getInt("AD_Client_ID")
|
||||
+ " ,"
|
||||
+ v.getInt("AD_Org_ID")
|
||||
+ " ,'Y'"
|
||||
+ " ,SysDate,"
|
||||
+ v.getInt("UpdatedBy")
|
||||
+ " ,SysDate,"
|
||||
+ v.getInt("UpdatedBy")
|
||||
//
|
||||
//Price List
|
||||
//
|
||||
+ " ,COALESCE(currencyConvert(po.PriceList, po.C_Currency_ID, "
|
||||
+ v.getInt("C_Currency_ID")
|
||||
+ ", ? , "
|
||||
+ dl.getInt("C_ConversionType_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Client_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Org_ID")
|
||||
+ "),0)"
|
||||
|
||||
// Price Std
|
||||
+ " ,COALESCE(currencyConvert(po.PriceList, po.C_Currency_ID, "
|
||||
+ v.getInt("C_Currency_ID")
|
||||
+ ", ? , "
|
||||
+ dl.getInt("C_ConversionType_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Client_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Org_ID")
|
||||
+ "),0)"
|
||||
|
||||
// Price Limit
|
||||
+ " ,COALESCE(currencyConvert(po.PricePO ,po.C_Currency_ID, "
|
||||
+ v.getInt("C_Currency_ID")
|
||||
+ ",? , "
|
||||
+ dl.getInt("C_ConversionType_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Client_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Org_ID")
|
||||
+ "),0)"
|
||||
+ " FROM M_Product_PO po "
|
||||
+ " WHERE EXISTS (SELECT * FROM T_Selection s WHERE po.M_Product_ID=s.T_Selection_ID"
|
||||
+ " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ") "
|
||||
+ " AND po.IsCurrentVendor='Y' AND po.IsActive='Y'";
|
||||
sqlins = new StringBuilder("INSERT INTO M_ProductPrice ");
|
||||
sqlins.append("(M_PriceList_Version_ID");
|
||||
sqlins.append(" ,M_Product_ID ");
|
||||
sqlins.append(" ,AD_Client_ID");
|
||||
sqlins.append(" , AD_Org_ID");
|
||||
sqlins.append(" , IsActive");
|
||||
sqlins.append(" , Created");
|
||||
sqlins.append(" , CreatedBy");
|
||||
sqlins.append(" , Updated");
|
||||
sqlins.append(" , UpdatedBy");
|
||||
sqlins.append(" , PriceList");
|
||||
sqlins.append(" , PriceStd");
|
||||
sqlins.append(" , PriceLimit) ");
|
||||
sqlins.append("SELECT ");
|
||||
sqlins.append(p_PriceList_Version_ID);
|
||||
sqlins.append(" ,po.M_Product_ID ");
|
||||
sqlins.append(" ,");
|
||||
sqlins.append(v.getInt("AD_Client_ID"));
|
||||
sqlins.append(" ,");
|
||||
sqlins.append(v.getInt("AD_Org_ID"));
|
||||
sqlins.append(" ,'Y'");
|
||||
sqlins.append(" ,SysDate,");
|
||||
sqlins.append(v.getInt("UpdatedBy"));
|
||||
sqlins.append(" ,SysDate,");
|
||||
sqlins.append(v.getInt("UpdatedBy"));
|
||||
//
|
||||
//Price List
|
||||
//
|
||||
sqlins.append(" ,COALESCE(currencyConvert(po.PriceList, po.C_Currency_ID, ");
|
||||
sqlins.append(v.getInt("C_Currency_ID"));
|
||||
sqlins.append(", ? , ");
|
||||
sqlins.append(dl.getInt("C_ConversionType_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Client_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Org_ID"));
|
||||
sqlins.append("),0)");
|
||||
|
||||
// Price Std
|
||||
sqlins.append(" ,COALESCE(currencyConvert(po.PriceList, po.C_Currency_ID, ");
|
||||
sqlins.append(v.getInt("C_Currency_ID"));
|
||||
sqlins.append(", ? , ");
|
||||
sqlins.append(dl.getInt("C_ConversionType_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Client_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Org_ID"));
|
||||
sqlins.append("),0)");
|
||||
|
||||
// Price Limit
|
||||
sqlins.append(" ,COALESCE(currencyConvert(po.PricePO ,po.C_Currency_ID, ");
|
||||
sqlins.append(v.getInt("C_Currency_ID"));
|
||||
sqlins.append(",? , ");
|
||||
sqlins.append(dl.getInt("C_ConversionType_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Client_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Org_ID"));
|
||||
sqlins.append("),0)");
|
||||
sqlins.append(" FROM M_Product_PO po ");
|
||||
sqlins.append(" WHERE EXISTS (SELECT * FROM T_Selection s WHERE po.M_Product_ID=s.T_Selection_ID");
|
||||
sqlins.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(") ");
|
||||
sqlins.append(" AND po.IsCurrentVendor='Y' AND po.IsActive='Y'");
|
||||
|
||||
PreparedStatement pstmt = DB.prepareStatement(sqlins,
|
||||
PreparedStatement pstmt = DB.prepareStatement(sqlins.toString(),
|
||||
ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, get_TrxName());
|
||||
pstmt.setTimestamp(1, dl.getTimestamp("ConversionDate"));
|
||||
|
@ -481,68 +486,68 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
if (cnti == -1)
|
||||
raiseError(
|
||||
" INSERT INTO T_Selection from existing PriceList",
|
||||
sqlins);
|
||||
sqlins.toString());
|
||||
toti += cnti;
|
||||
log.fine("Inserted " + cnti);
|
||||
} else {
|
||||
//
|
||||
//Copy and Convert from other PriceList_Version
|
||||
//
|
||||
sqlins = "INSERT INTO M_ProductPrice "
|
||||
+ " (M_PriceList_Version_ID, M_Product_ID,"
|
||||
+ " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,"
|
||||
+ " PriceList, PriceStd, PriceLimit)"
|
||||
+ " SELECT "
|
||||
+ p_PriceList_Version_ID
|
||||
+ ", pp.M_Product_ID,"
|
||||
+ v.getInt("AD_Client_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Org_ID")
|
||||
+ ", 'Y', SysDate, "
|
||||
+ v.getInt("UpdatedBy")
|
||||
+ ", SysDate, "
|
||||
+ v.getInt("UpdatedBy")
|
||||
+ " ,"
|
||||
// Price List
|
||||
+ "COALESCE(currencyConvert(pp.PriceList, pl.C_Currency_ID, "
|
||||
+ v.getInt("C_Currency_ID")
|
||||
+ ", ?, "
|
||||
+ dl.getInt("C_ConversionType_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Client_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Org_ID")
|
||||
+ "),0),"
|
||||
// Price Std
|
||||
+ "COALESCE(currencyConvert(pp.PriceStd,pl.C_Currency_ID, "
|
||||
+ v.getInt("C_Currency_ID")
|
||||
+ " , ? , "
|
||||
+ dl.getInt("C_ConversionType_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Client_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Org_ID")
|
||||
+ "),0),"
|
||||
//Price Limit
|
||||
+ " COALESCE(currencyConvert(pp.PriceLimit,pl.C_Currency_ID, "
|
||||
+ v.getInt("C_Currency_ID")
|
||||
+ " , ? , "
|
||||
+ dl.getInt("C_ConversionType_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Client_ID")
|
||||
+ ", "
|
||||
+ v.getInt("AD_Org_ID")
|
||||
+ "),0)"
|
||||
+ " FROM M_ProductPrice pp"
|
||||
+ " INNER JOIN M_PriceList_Version plv ON (pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID)"
|
||||
+ " INNER JOIN M_PriceList pl ON (plv.M_PriceList_ID=pl.M_PriceList_ID)"
|
||||
+ " WHERE pp.M_PriceList_Version_ID="
|
||||
+ v.getInt("M_PriceList_Version_Base_ID")
|
||||
+ " AND EXISTS (SELECT * FROM T_Selection s WHERE pp.M_Product_ID=s.T_Selection_ID"
|
||||
+ " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")"
|
||||
+ "AND pp.IsActive='Y'";
|
||||
sqlins = new StringBuilder("INSERT INTO M_ProductPrice ");
|
||||
sqlins.append(" (M_PriceList_Version_ID, M_Product_ID,");
|
||||
sqlins.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,");
|
||||
sqlins.append(" PriceList, PriceStd, PriceLimit)");
|
||||
sqlins.append(" SELECT ");
|
||||
sqlins.append(p_PriceList_Version_ID);
|
||||
sqlins.append(", pp.M_Product_ID,");
|
||||
sqlins.append(v.getInt("AD_Client_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Org_ID"));
|
||||
sqlins.append(", 'Y', SysDate, ");
|
||||
sqlins.append(v.getInt("UpdatedBy"));
|
||||
sqlins.append(", SysDate, ");
|
||||
sqlins.append(v.getInt("UpdatedBy"));
|
||||
sqlins.append(" ,");
|
||||
// Price List
|
||||
sqlins.append("COALESCE(currencyConvert(pp.PriceList, pl.C_Currency_ID, ");
|
||||
sqlins.append(v.getInt("C_Currency_ID"));
|
||||
sqlins.append(", ?, ");
|
||||
sqlins.append(dl.getInt("C_ConversionType_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Client_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Org_ID"));
|
||||
sqlins.append("),0),");
|
||||
// Price Std
|
||||
sqlins.append("COALESCE(currencyConvert(pp.PriceStd,pl.C_Currency_ID, ");
|
||||
sqlins.append(v.getInt("C_Currency_ID"));
|
||||
sqlins.append(" , ? , ");
|
||||
sqlins.append(dl.getInt("C_ConversionType_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Client_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Org_ID"));
|
||||
sqlins.append("),0),");
|
||||
//Price Limit
|
||||
sqlins.append(" COALESCE(currencyConvert(pp.PriceLimit,pl.C_Currency_ID, ");
|
||||
sqlins.append(v.getInt("C_Currency_ID"));
|
||||
sqlins.append(" , ? , ");
|
||||
sqlins.append(dl.getInt("C_ConversionType_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Client_ID"));
|
||||
sqlins.append(", ");
|
||||
sqlins.append(v.getInt("AD_Org_ID"));
|
||||
sqlins.append("),0)");
|
||||
sqlins.append(" FROM M_ProductPrice pp");
|
||||
sqlins.append(" INNER JOIN M_PriceList_Version plv ON (pp.M_PriceList_Version_ID=plv.M_PriceList_Version_ID)");
|
||||
sqlins.append(" INNER JOIN M_PriceList pl ON (plv.M_PriceList_ID=pl.M_PriceList_ID)");
|
||||
sqlins.append(" WHERE pp.M_PriceList_Version_ID=");
|
||||
sqlins.append(v.getInt("M_PriceList_Version_Base_ID"));
|
||||
sqlins.append(" AND EXISTS (SELECT * FROM T_Selection s WHERE pp.M_Product_ID=s.T_Selection_ID");
|
||||
sqlins.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")");
|
||||
sqlins.append("AND pp.IsActive='Y'");
|
||||
|
||||
PreparedStatement pstmt = DB.prepareStatement(sqlins,
|
||||
PreparedStatement pstmt = DB.prepareStatement(sqlins.toString(),
|
||||
ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, get_TrxName());
|
||||
pstmt.setTimestamp(1, dl.getTimestamp("ConversionDate"));
|
||||
|
@ -554,32 +559,33 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
if (cnti == -1)
|
||||
raiseError(
|
||||
" INSERT INTO T_Selection from existing PriceList",
|
||||
sqlins);
|
||||
sqlins.toString());
|
||||
toti += cnti;
|
||||
log.fine("Inserted " + cnti);
|
||||
|
||||
}
|
||||
Message = Message + ", @Inserted@=" + cnti;
|
||||
Message.append(", @Inserted@=").append(cnti);
|
||||
//
|
||||
// Calculation
|
||||
//
|
||||
sqlupd = "UPDATE M_ProductPrice p "
|
||||
+ " SET PriceList = (DECODE( '"
|
||||
+ dl.getString("List_Base")
|
||||
+ "', 'S', PriceStd, 'X', PriceLimit, PriceList)"
|
||||
+ " + ?) * (1 - ?/100)," + " PriceStd = (DECODE('"
|
||||
+ dl.getString("Std_Base")
|
||||
+ "', 'L', PriceList, 'X', PriceLimit, PriceStd) "
|
||||
+ " + ?) * (1 - ?/100), " + " PriceLimit = (DECODE('"
|
||||
+ dl.getString("Limit_Base")
|
||||
+ "', 'L', PriceList, 'S', PriceStd, PriceLimit) "
|
||||
+ " + ?) * (1 - ? /100) "
|
||||
+ " WHERE M_PriceList_Version_ID = "
|
||||
+ p_PriceList_Version_ID
|
||||
+ " AND EXISTS (SELECT * FROM T_Selection s "
|
||||
+ " WHERE s.T_Selection_ID = p.M_Product_ID"
|
||||
+ " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")";
|
||||
PreparedStatement pstmu = DB.prepareStatement(sqlupd,
|
||||
sqlupd = new StringBuilder("UPDATE M_ProductPrice p ");
|
||||
sqlupd.append(" SET PriceList = (DECODE( '");
|
||||
sqlupd.append(dl.getString("List_Base"));
|
||||
sqlupd.append("', 'S', PriceStd, 'X', PriceLimit, PriceList)");
|
||||
sqlupd.append(" + ?) * (1 - ?/100), PriceStd = (DECODE('");
|
||||
sqlupd.append(dl.getString("Std_Base"));
|
||||
sqlupd.append("', 'L', PriceList, 'X', PriceLimit, PriceStd) ");
|
||||
sqlupd.append(" + ?) * (1 - ?/100), ").append(" PriceLimit = (DECODE('");
|
||||
sqlupd.append(dl.getString("Limit_Base"));
|
||||
sqlupd.append("', 'L', PriceList, 'S', PriceStd, PriceLimit) ");
|
||||
sqlupd.append(" + ?) * (1 - ? /100) ");
|
||||
sqlupd.append(" WHERE M_PriceList_Version_ID = ");
|
||||
sqlupd.append(p_PriceList_Version_ID);
|
||||
sqlupd.append(" AND EXISTS (SELECT * FROM T_Selection s ");
|
||||
sqlupd.append(" WHERE s.T_Selection_ID = p.M_Product_ID");
|
||||
sqlupd.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")");
|
||||
|
||||
PreparedStatement pstmu = DB.prepareStatement(sqlupd.toString(),
|
||||
ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_UPDATABLE, get_TrxName());
|
||||
|
||||
|
@ -593,90 +599,92 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
cntu = pstmu.executeUpdate();
|
||||
|
||||
if (cntu == -1)
|
||||
raiseError("Update M_ProductPrice ", sqlupd);
|
||||
raiseError("Update M_ProductPrice ", sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
|
||||
//
|
||||
//Rounding (AD_Reference_ID=155)
|
||||
//
|
||||
sqlupd = "UPDATE M_ProductPrice p "
|
||||
+ " SET PriceList = DECODE('"
|
||||
+ dl.getString("List_Rounding") + "',"
|
||||
+ " 'N', PriceList, "
|
||||
+ " '0', ROUND(PriceList, 0)," //Even .00
|
||||
+ " 'D', ROUND(PriceList, 1)," //Dime .10
|
||||
+ " 'T', ROUND(PriceList, -1), " //Ten 10.00
|
||||
+ " '5', ROUND(PriceList*20,0)/20," //Nickle .05
|
||||
+ " 'Q', ROUND(PriceList*4,0)/4," //Quarter .25
|
||||
+ " '9', CASE" //Whole 9 or 5
|
||||
+ " WHEN MOD(ROUND(PriceList),10)<=5 THEN ROUND(PriceList)+(5-MOD(ROUND(PriceList),10))"
|
||||
+ " WHEN MOD(ROUND(PriceList),10)>5 THEN ROUND(PriceList)+(9-MOD(ROUND(PriceList),10)) END,"
|
||||
+ " ROUND(PriceList, " + v.getInt("StdPrecision")
|
||||
+ "))," //Currency
|
||||
+ " PriceStd = DECODE('" + dl.getString("Std_Rounding")
|
||||
+ "'," + " 'N', PriceStd, "
|
||||
+ " '0', ROUND(PriceStd, 0), " //Even .00
|
||||
+ " 'D', ROUND(PriceStd, 1), " //Dime .10
|
||||
+ "'T', ROUND(PriceStd, -1)," //Ten 10.00
|
||||
+ "'5', ROUND(PriceStd*20,0)/20," //Nickle .05
|
||||
+ "'Q', ROUND(PriceStd*4,0)/4," //Quarter .25
|
||||
+ " '9', CASE" //Whole 9 or 5
|
||||
+ " WHEN MOD(ROUND(PriceStd),10)<=5 THEN ROUND(PriceStd)+(5-MOD(ROUND(PriceStd),10))"
|
||||
+ " WHEN MOD(ROUND(PriceStd),10)>5 THEN ROUND(PriceStd)+(9-MOD(ROUND(PriceStd),10)) END,"
|
||||
+ "ROUND(PriceStd, " + v.getInt("StdPrecision") + "))," //Currency
|
||||
+ "PriceLimit = DECODE('"
|
||||
+ dl.getString("Limit_Rounding") + "', "
|
||||
+ " 'N', PriceLimit, "
|
||||
+ " '0', ROUND(PriceLimit, 0), " // Even .00
|
||||
+ " 'D', ROUND(PriceLimit, 1), " // Dime .10
|
||||
+ " 'T', ROUND(PriceLimit, -1), " // Ten 10.00
|
||||
+ " '5', ROUND(PriceLimit*20,0)/20, " // Nickle .05
|
||||
+ " 'Q', ROUND(PriceLimit*4,0)/4, " //Quarter .25
|
||||
+ " '9', CASE" //Whole 9 or 5
|
||||
+ " WHEN MOD(ROUND(PriceLimit),10)<=5 THEN ROUND(PriceLimit)+(5-MOD(ROUND(PriceLimit),10))"
|
||||
+ " WHEN MOD(ROUND(PriceLimit),10)>5 THEN ROUND(PriceLimit)+(9-MOD(ROUND(PriceLimit),10)) END,"
|
||||
+ " ROUND(PriceLimit, " + v.getInt("StdPrecision")
|
||||
+ ")) " // Currency
|
||||
+ " WHERE M_PriceList_Version_ID="
|
||||
+ p_PriceList_Version_ID
|
||||
+ " AND EXISTS (SELECT * FROM T_Selection s "
|
||||
+ " WHERE s.T_Selection_ID=p.M_Product_ID"
|
||||
+ " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")";
|
||||
cntu = DB.executeUpdate(sqlupd, get_TrxName());
|
||||
sqlupd = new StringBuilder("UPDATE M_ProductPrice p ");
|
||||
sqlupd.append(" SET PriceList = DECODE('");
|
||||
sqlupd.append(dl.getString("List_Rounding")).append("',");
|
||||
sqlupd.append(" 'N', PriceList, ");
|
||||
sqlupd.append(" '0', ROUND(PriceList, 0),"); //Even .00
|
||||
sqlupd.append(" 'D', ROUND(PriceList, 1),"); //Dime .10
|
||||
sqlupd.append(" 'T', ROUND(PriceList, -1), "); //Ten 10.00
|
||||
sqlupd.append(" '5', ROUND(PriceList*20,0)/20,"); //Nickle .05
|
||||
sqlupd.append(" 'Q', ROUND(PriceList*4,0)/4,"); //Quarter .25
|
||||
sqlupd.append(" '9', CASE"); //Whole 9 or 5
|
||||
sqlupd.append(" WHEN MOD(ROUND(PriceList),10)<=5 THEN ROUND(PriceList)+(5-MOD(ROUND(PriceList),10))");
|
||||
sqlupd.append(" WHEN MOD(ROUND(PriceList),10)>5 THEN ROUND(PriceList)+(9-MOD(ROUND(PriceList),10)) END,");
|
||||
sqlupd.append(" ROUND(PriceList, ").append(v.getInt("StdPrecision"));
|
||||
sqlupd.append(")),");//Currency
|
||||
sqlupd.append(" PriceStd = DECODE('").append(dl.getString("Std_Rounding"));
|
||||
sqlupd.append("',").append(" 'N', PriceStd, ");
|
||||
sqlupd.append(" '0', ROUND(PriceStd, 0), "); //Even .00
|
||||
sqlupd.append(" 'D', ROUND(PriceStd, 1), "); //Dime .10
|
||||
sqlupd.append("'T', ROUND(PriceStd, -1),"); //Ten 10.00)
|
||||
sqlupd.append("'5', ROUND(PriceStd*20,0)/20,"); //Nickle .05
|
||||
sqlupd.append("'Q', ROUND(PriceStd*4,0)/4,"); //Quarter .25
|
||||
sqlupd.append(" '9', CASE"); //Whole 9 or 5
|
||||
sqlupd.append(" WHEN MOD(ROUND(PriceStd),10)<=5 THEN ROUND(PriceStd)+(5-MOD(ROUND(PriceStd),10))");
|
||||
sqlupd.append(" WHEN MOD(ROUND(PriceStd),10)>5 THEN ROUND(PriceStd)+(9-MOD(ROUND(PriceStd),10)) END,");
|
||||
sqlupd.append("ROUND(PriceStd, ").append(v.getInt("StdPrecision")).append(")),"); //Currency
|
||||
sqlupd.append("PriceLimit = DECODE('");
|
||||
sqlupd.append(dl.getString("Limit_Rounding")).append("', ");
|
||||
sqlupd.append(" 'N', PriceLimit, ");
|
||||
sqlupd.append(" '0', ROUND(PriceLimit, 0), "); // Even .00
|
||||
sqlupd.append(" 'D', ROUND(PriceLimit, 1), "); // Dime .10
|
||||
sqlupd.append(" 'T', ROUND(PriceLimit, -1), "); // Ten 10.00
|
||||
sqlupd.append(" '5', ROUND(PriceLimit*20,0)/20, "); // Nickle .05
|
||||
sqlupd.append(" 'Q', ROUND(PriceLimit*4,0)/4, "); //Quarter .25
|
||||
sqlupd.append(" '9', CASE"); //Whole 9 or 5
|
||||
sqlupd.append(" WHEN MOD(ROUND(PriceLimit),10)<=5 THEN ROUND(PriceLimit)+(5-MOD(ROUND(PriceLimit),10))");
|
||||
sqlupd.append(" WHEN MOD(ROUND(PriceLimit),10)>5 THEN ROUND(PriceLimit)+(9-MOD(ROUND(PriceLimit),10)) END,");
|
||||
sqlupd.append(" ROUND(PriceLimit, ").append(v.getInt("StdPrecision"));
|
||||
sqlupd.append(")) "); // Currency
|
||||
sqlupd.append(" WHERE M_PriceList_Version_ID=");
|
||||
sqlupd.append(p_PriceList_Version_ID);
|
||||
sqlupd.append(" AND EXISTS (SELECT * FROM T_Selection s ");
|
||||
sqlupd.append(" WHERE s.T_Selection_ID=p.M_Product_ID");
|
||||
sqlupd.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")");
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName());
|
||||
if (cntu == -1)
|
||||
raiseError("Update M_ProductPrice ", sqlupd);
|
||||
raiseError("Update M_ProductPrice ", sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
|
||||
Message = Message + ", @Updated@=" + cntu;
|
||||
Message.append(", @Updated@=").append(cntu);
|
||||
//
|
||||
//Fixed Price overwrite
|
||||
//
|
||||
sqlupd = "UPDATE M_ProductPrice p "
|
||||
+ " SET PriceList = DECODE('"
|
||||
+ dl.getString("List_Base") + "', 'F', "
|
||||
+ dl.getDouble("List_Fixed") + ", PriceList), "
|
||||
+ " PriceStd = DECODE('"
|
||||
+ dl.getString("Std_Base") + "', 'F', "
|
||||
+ dl.getDouble("Std_Fixed") + ", PriceStd),"
|
||||
+ " PriceLimit = DECODE('"
|
||||
+ dl.getString("Limit_Base") + "', 'F', "
|
||||
+ dl.getDouble("Limit_Fixed") + ", PriceLimit)"
|
||||
+ " WHERE M_PriceList_Version_ID="
|
||||
+ p_PriceList_Version_ID
|
||||
+ " AND EXISTS (SELECT * FROM T_Selection s"
|
||||
+ " WHERE s.T_Selection_ID=p.M_Product_ID"
|
||||
+ " AND s.AD_PInstance_ID=" + m_AD_PInstance_ID + ")";
|
||||
cntu = DB.executeUpdate(sqlupd, get_TrxName());
|
||||
sqlupd = new StringBuilder("UPDATE M_ProductPrice p ");
|
||||
sqlupd.append(" SET PriceList = DECODE('");
|
||||
sqlupd.append(dl.getString("List_Base")).append("', 'F', ");
|
||||
sqlupd.append(dl.getDouble("List_Fixed")).append(", PriceList), ");
|
||||
sqlupd.append(" PriceStd = DECODE('");
|
||||
sqlupd.append(dl.getString("Std_Base")).append("', 'F', ");
|
||||
sqlupd.append(dl.getDouble("Std_Fixed")).append(", PriceStd),");
|
||||
sqlupd.append(" PriceLimit = DECODE('");
|
||||
sqlupd.append(dl.getString("Limit_Base")).append("', 'F', ");
|
||||
sqlupd.append(dl.getDouble("Limit_Fixed")).append(", PriceLimit)");
|
||||
sqlupd.append(" WHERE M_PriceList_Version_ID=");
|
||||
sqlupd.append(p_PriceList_Version_ID);
|
||||
sqlupd.append(" AND EXISTS (SELECT * FROM T_Selection s");
|
||||
sqlupd.append(" WHERE s.T_Selection_ID=p.M_Product_ID");
|
||||
sqlupd.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID).append(")");
|
||||
|
||||
cntu = DB.executeUpdate(sqlupd.toString(), get_TrxName());
|
||||
if (cntu == -1)
|
||||
raiseError("Update M_ProductPrice ", sqlupd);
|
||||
raiseError("Update M_ProductPrice ", sqlupd.toString());
|
||||
totu += cntu;
|
||||
log.fine("Updated " + cntu);
|
||||
|
||||
v_NextNo = v_NextNo + 1;
|
||||
addLog(0, null, null, Message);
|
||||
Message = "";
|
||||
addLog(0, null, null, Message.toString());
|
||||
Message = new StringBuilder();
|
||||
}
|
||||
dl.close();
|
||||
Cur_DiscountLine.close();
|
||||
|
@ -685,10 +693,10 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
//
|
||||
// Delete Temporary Selection
|
||||
//
|
||||
sqldel = "DELETE FROM T_Selection ";
|
||||
cntd = DB.executeUpdate(sqldel, get_TrxName());
|
||||
sqldel = new StringBuilder("DELETE FROM T_Selection ");
|
||||
cntd = DB.executeUpdate(sqldel.toString(), get_TrxName());
|
||||
if (cntd == -1)
|
||||
raiseError(" DELETE T_Selection ", sqldel);
|
||||
raiseError(" DELETE T_Selection ", sqldel.toString());
|
||||
totd += cntd;
|
||||
log.fine("Deleted " + cntd);
|
||||
|
||||
|
@ -710,12 +718,12 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
private void raiseError(String string, String sql) throws Exception {
|
||||
|
||||
// DB.rollback(false, get_TrxName());
|
||||
String msg = string;
|
||||
StringBuilder msg = new StringBuilder(string);
|
||||
ValueNamePair pp = CLogger.retrieveError();
|
||||
if (pp != null)
|
||||
msg = pp.getName() + " - ";
|
||||
msg += sql;
|
||||
throw new AdempiereUserError(msg);
|
||||
msg = new StringBuilder(pp.getName()).append(" - ");
|
||||
msg.append(sql);
|
||||
throw new AdempiereUserError(msg.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -727,7 +735,7 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
private String getSubCategoryWhereClause(int productCategoryId) throws SQLException, AdempiereSystemError{
|
||||
//if a node with this id is found later in the search we have a loop in the tree
|
||||
int subTreeRootParentId = 0;
|
||||
String retString = " ";
|
||||
StringBuilder retString = new StringBuilder();
|
||||
String sql = " SELECT M_Product_Category_ID, M_Product_Category_Parent_ID FROM M_Product_Category";
|
||||
final Vector<SimpleTreeNode> categories = new Vector<SimpleTreeNode>(100);
|
||||
Statement stmt = DB.createStatement();
|
||||
|
@ -738,10 +746,10 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
}
|
||||
categories.add(new SimpleTreeNode(rs.getInt(1), rs.getInt(2)));
|
||||
}
|
||||
retString += getSubCategoriesString(productCategoryId, categories, subTreeRootParentId);
|
||||
retString.append(getSubCategoriesString(productCategoryId, categories, subTreeRootParentId));
|
||||
rs.close();
|
||||
stmt.close();
|
||||
return retString;
|
||||
return retString.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -753,7 +761,7 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
* @throws AdempiereSystemError if a loop is detected
|
||||
*/
|
||||
private String getSubCategoriesString(int productCategoryId, Vector<SimpleTreeNode> categories, int loopIndicatorId) throws AdempiereSystemError {
|
||||
String ret = "";
|
||||
StringBuilder ret = new StringBuilder();
|
||||
final Iterator iter = categories.iterator();
|
||||
while (iter.hasNext()) {
|
||||
SimpleTreeNode node = (SimpleTreeNode) iter.next();
|
||||
|
@ -761,11 +769,12 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
if (node.getNodeId() == loopIndicatorId) {
|
||||
throw new AdempiereSystemError("The product category tree contains a loop on categoryId: " + loopIndicatorId);
|
||||
}
|
||||
ret = ret + getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId) + ",";
|
||||
ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId));
|
||||
ret.append(",");
|
||||
}
|
||||
}
|
||||
log.fine(ret);
|
||||
return ret + productCategoryId;
|
||||
log.fine(ret.toString());
|
||||
return ret.toString() + productCategoryId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -793,6 +802,6 @@ public class M_PriceList_Create extends SvrProcess {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // M_PriceList_Create
|
|
@ -73,7 +73,7 @@ public class M_Product_BOM_Check extends SvrProcess
|
|||
*/
|
||||
protected String doIt() throws Exception
|
||||
{
|
||||
StringBuffer sql1 = null;
|
||||
StringBuilder sql1 = null;
|
||||
int no = 0;
|
||||
|
||||
log.info("Check BOM Structure");
|
||||
|
@ -90,20 +90,20 @@ public class M_Product_BOM_Check extends SvrProcess
|
|||
}
|
||||
|
||||
// Table to put all BOMs - duplicate will cause exception
|
||||
sql1 = new StringBuffer("DELETE FROM T_Selection2 WHERE Query_ID = 0 AND AD_PInstance_ID="+ m_AD_PInstance_ID);
|
||||
sql1 = new StringBuilder("DELETE FROM T_Selection2 WHERE Query_ID = 0 AND AD_PInstance_ID=").append(m_AD_PInstance_ID);
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
sql1 = new StringBuffer("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) VALUES ("
|
||||
+ m_AD_PInstance_ID
|
||||
+ ", 0, "
|
||||
+ p_Record_ID + ")");
|
||||
sql1 = new StringBuilder("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) VALUES (")
|
||||
.append(m_AD_PInstance_ID)
|
||||
.append(", 0, ")
|
||||
.append(p_Record_ID).append(")");
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
// Table of root modes
|
||||
sql1 = new StringBuffer("DELETE FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID);
|
||||
sql1 = new StringBuilder("DELETE FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID);
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
sql1 = new StringBuffer("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) VALUES ("
|
||||
+ m_AD_PInstance_ID
|
||||
+ ", "
|
||||
+ p_Record_ID + ")");
|
||||
sql1 = new StringBuilder("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) VALUES (")
|
||||
.append(m_AD_PInstance_ID)
|
||||
.append(", ")
|
||||
.append(p_Record_ID).append(")");
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
|
||||
while (true) {
|
||||
|
@ -112,8 +112,8 @@ public class M_Product_BOM_Check extends SvrProcess
|
|||
int countno = 0;
|
||||
try
|
||||
{
|
||||
PreparedStatement pstmt = DB.prepareStatement
|
||||
("SELECT COUNT(*) FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID, get_TrxName());
|
||||
StringBuilder dbpst = new StringBuilder("SELECT COUNT(*) FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID);
|
||||
PreparedStatement pstmt = DB.prepareStatement(dbpst.toString(), get_TrxName());
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
if (rs.next())
|
||||
countno = rs.getInt(1);
|
||||
|
@ -133,31 +133,31 @@ public class M_Product_BOM_Check extends SvrProcess
|
|||
{
|
||||
// if any command fails (no==-1) break and inform failure
|
||||
// Insert BOM Nodes into "All" table
|
||||
sql1 = new StringBuffer("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) "
|
||||
+ "SELECT " + m_AD_PInstance_ID + ", 0, p.M_Product_ID FROM M_Product p WHERE IsBOM='Y' AND EXISTS "
|
||||
sql1 = new StringBuilder("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) ")
|
||||
.append("SELECT ").append(m_AD_PInstance_ID).append(", 0, p.M_Product_ID FROM M_Product p WHERE IsBOM='Y' AND EXISTS ")
|
||||
//+ "(SELECT * FROM M_Product_BOM b WHERE p.M_Product_ID=b.M_ProductBOM_ID AND b.M_Product_ID IN "
|
||||
+ "(SELECT * FROM PP_Product_BOM b WHERE p.M_Product_ID=b.M_Product_ID AND b.M_Product_ID IN "
|
||||
+ "(SELECT T_Selection_ID FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID + "))");
|
||||
.append("(SELECT * FROM PP_Product_BOM b WHERE p.M_Product_ID=b.M_Product_ID AND b.M_Product_ID IN ")
|
||||
.append("(SELECT T_Selection_ID FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID).append("))");
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString());
|
||||
// Insert BOM Nodes into temporary table
|
||||
sql1 = new StringBuffer("DELETE FROM T_Selection2 WHERE Query_ID = 1 AND AD_PInstance_ID="+ m_AD_PInstance_ID);
|
||||
sql1 = new StringBuilder("DELETE FROM T_Selection2 WHERE Query_ID = 1 AND AD_PInstance_ID=").append(m_AD_PInstance_ID);
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString());
|
||||
sql1 = new StringBuffer("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) "
|
||||
+ "SELECT " + m_AD_PInstance_ID + ", 1, p.M_Product_ID FROM M_Product p WHERE IsBOM='Y' AND EXISTS "
|
||||
sql1 = new StringBuilder("INSERT INTO T_Selection2 (AD_PInstance_ID, Query_ID, T_Selection_ID) ")
|
||||
.append("SELECT ").append(m_AD_PInstance_ID).append(", 1, p.M_Product_ID FROM M_Product p WHERE IsBOM='Y' AND EXISTS ")
|
||||
//+ "(SELECT * FROM M_Product_BOM b WHERE p.M_Product_ID=b.M_ProductBOM_ID AND b.M_Product_ID IN "
|
||||
+ "(SELECT * FROM PP_Product_BOM b WHERE p.M_Product_ID=b.M_Product_ID AND b.M_Product_ID IN "
|
||||
+ "(SELECT T_Selection_ID FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID + "))");
|
||||
.append("(SELECT * FROM PP_Product_BOM b WHERE p.M_Product_ID=b.M_Product_ID AND b.M_Product_ID IN ")
|
||||
.append("(SELECT T_Selection_ID FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID).append("))");
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString());
|
||||
// Copy into root table
|
||||
sql1 = new StringBuffer("DELETE FROM T_Selection WHERE AD_PInstance_ID="+ m_AD_PInstance_ID);
|
||||
sql1 = new StringBuilder("DELETE FROM T_Selection WHERE AD_PInstance_ID=").append(m_AD_PInstance_ID);
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString());
|
||||
sql1 = new StringBuffer("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) "
|
||||
+ "SELECT " + m_AD_PInstance_ID + ", T_Selection_ID "
|
||||
+ "FROM T_Selection2 WHERE Query_ID = 1 AND AD_PInstance_ID="+ m_AD_PInstance_ID);
|
||||
sql1 = new StringBuilder("INSERT INTO T_Selection (AD_PInstance_ID, T_Selection_ID) ")
|
||||
.append("SELECT ").append(m_AD_PInstance_ID).append(", T_Selection_ID ")
|
||||
.append("FROM T_Selection2 WHERE Query_ID = 1 AND AD_PInstance_ID=").append(m_AD_PInstance_ID);
|
||||
no = DB.executeUpdate(sql1.toString(), get_TrxName());
|
||||
if (no == -1) raiseError("InsertingRoot:ERROR", sql1.toString());
|
||||
}
|
||||
|
@ -176,12 +176,12 @@ public class M_Product_BOM_Check extends SvrProcess
|
|||
|
||||
private void raiseError(String string, String sql) throws Exception {
|
||||
DB.rollback(false, get_TrxName());
|
||||
String msg = string;
|
||||
StringBuilder msg = new StringBuilder(string);
|
||||
ValueNamePair pp = CLogger.retrieveError();
|
||||
if (pp != null)
|
||||
msg = pp.getName() + " - ";
|
||||
msg += sql;
|
||||
throw new AdempiereUserError (msg);
|
||||
msg = new StringBuilder(pp.getName()).append(" - ");
|
||||
msg.append(sql);
|
||||
throw new AdempiereUserError (msg.toString());
|
||||
}
|
||||
|
||||
} // M_Product_BOM_Check
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue