Merge b2d0ef3e00eb (development branch) into 01f827cc13c3 (zk7 branch)

This commit is contained in:
Heng Sin Low 2014-04-27 20:14:21 +08:00
commit 765a5f83fa
65 changed files with 3145 additions and 178 deletions

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 8, 2014 3:18:45 PM CEST
-- IDEMPIERE-1891
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200269,'0b36ffa9-8364-4d93-8d9a-1e3eae4aa81b',0,TO_DATE('2014-04-08 15:18:44','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','You cannot access process {0} with your role : {1}','I',TO_DATE('2014-04-08 15:18:44','YYYY-MM-DD HH24:MI:SS'),100,'CannotAccessProcess')
;
SELECT register_migration_script('201404081520_IDEMPIERE-1891.sql') FROM dual
;

View File

@ -0,0 +1,15 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 11, 2014 10:56:44 AM COT
-- IDEMPIERE-1877 Product Info Window Implementation broke the usage of barcode reader
UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_DATE('2014-04-11 10:56:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200003
;
-- Apr 11, 2014 10:56:47 AM COT
UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_DATE('2014-04-11 10:56:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200004
;
SELECT register_migration_script('201404111058_IDEMPIERE-1877.sql') FROM dual
;

View File

@ -0,0 +1,7 @@
-- Apr 8, 2014 3:18:45 PM CEST
-- IDEMPIERE-1891
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200269,'0b36ffa9-8364-4d93-8d9a-1e3eae4aa81b',0,TO_TIMESTAMP('2014-04-08 15:18:44','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','You cannot access process {0} with your role : {1}','I',TO_TIMESTAMP('2014-04-08 15:18:44','YYYY-MM-DD HH24:MI:SS'),100,'CannotAccessProcess')
;
SELECT register_migration_script('201404081520_IDEMPIERE-1891.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- Apr 11, 2014 10:56:44 AM COT
-- IDEMPIERE-1877 Product Info Window Implementation broke the usage of barcode reader
UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_TIMESTAMP('2014-04-11 10:56:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200003
;
-- Apr 11, 2014 10:56:47 AM COT
UPDATE AD_InfoColumn SET IsIdentifier='Y',Updated=TO_TIMESTAMP('2014-04-11 10:56:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200004
;
SELECT register_migration_script('201404111058_IDEMPIERE-1877.sql') FROM dual
;

View File

@ -0,0 +1,423 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 18, 2014 2:46:09 PM MYT
-- IDEMPIERE-1715 Implement revert action for Production (Single Product)
INSERT INTO AD_Workflow (ValidateWorkflow,Cost,WaitingTime,WorkingTime,AccessLevel,Duration,DurationUnit,IsDefault,IsValid,Limit,Priority,PublishStatus,Version,SetupTime,QtyBatchSize,MovingTime,IsBetaFunctionality,OverlapUnits,UnitsCycles,Yield,QueuingTime,WorkflowType,Value,Name,AD_Workflow_UU,Author,DocumentNo,AD_Workflow_ID,UpdatedBy,Updated,Created,CreatedBy,IsActive,AD_Client_ID,EntityType,AD_Table_ID,AD_Org_ID) VALUES ('N',0,0,0,'1',0,'D','N','N',0,0,'R',0,0,1,0,'N',0,0,100,0,'P','Process_Production','Process_Production','cc9a6ab7-ff24-4c88-b35e-6a67dd76f405','iDempiere','10000000',200002,100,TO_DATE('2014-03-18 14:46:07','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2014-03-18 14:46:07','YYYY-MM-DD HH24:MI:SS'),100,'Y',0,'D',325,0)
;
-- Mar 18, 2014 2:46:11 PM MYT
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Cost,YPosition,OverlapUnits,UnitsCycles,Yield,WaitTime,Priority,Duration,IsCentrallyMaintained,JoinElement,Limit,WorkingTime,XPosition,WaitingTime,IsMilestone,IsSubcontracting,SplitElement,Action,Description,Value,Name,AD_WF_Node_UU,DynPriorityChange,AD_Workflow_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,DocAction,AD_Client_ID,EntityType,AD_Org_ID) VALUES (200008,0,0,0,0,100,0,0,0,'Y','X',0,0,0,0,'N','N','X','D','(Standard Node)','(DocAuto)','(DocAuto)','a483ae3a-dc85-46e4-a384-a10e7ace85d2',0,200002,TO_DATE('2014-03-18 14:46:10','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-03-18 14:46:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','--',0,'D',0)
;
-- Mar 18, 2014 2:46:12 PM MYT
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Cost,YPosition,OverlapUnits,UnitsCycles,Yield,WaitTime,Priority,Duration,IsCentrallyMaintained,JoinElement,Limit,WorkingTime,XPosition,WaitingTime,IsMilestone,IsSubcontracting,SplitElement,Action,Description,Value,Name,AD_WF_Node_UU,DynPriorityChange,AD_Workflow_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,DocAction,AD_Client_ID,EntityType,AD_Org_ID) VALUES (200009,0,0,0,0,100,0,0,0,'Y','X',0,0,0,0,'N','N','X','D','(Standard Node)','(DocComplete)','(DocComplete)','20f82106-add0-454b-8179-5328c1707720',0,200002,TO_DATE('2014-03-18 14:46:11','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-03-18 14:46:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','CO',0,'D',0)
;
-- Mar 18, 2014 2:46:13 PM MYT
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Cost,YPosition,OverlapUnits,UnitsCycles,Yield,WaitTime,Priority,Duration,IsCentrallyMaintained,JoinElement,Limit,WorkingTime,XPosition,WaitingTime,IsMilestone,IsSubcontracting,SplitElement,Action,Description,Value,Name,AD_WF_Node_UU,DynPriorityChange,AD_Workflow_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,DocAction,AD_Client_ID,EntityType,AD_Org_ID) VALUES (200010,0,0,0,0,100,0,0,0,'Y','X',0,0,0,0,'N','N','X','D','(Standard Node)','(DocPrepare)','(DocPrepare)','011830f3-4834-4bb1-bebd-5e8d77ca8b5f',0,200002,TO_DATE('2014-03-18 14:46:12','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-03-18 14:46:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','PR',0,'D',0)
;
-- Mar 18, 2014 2:46:14 PM MYT
INSERT INTO AD_WF_NodeNext (SeqNo,IsStdUserWorkflow,AD_WF_NodeNext_ID,AD_WF_Node_ID,AD_WF_Next_ID,EntityType,AD_WF_NodeNext_UU,UpdatedBy,CreatedBy,Updated,AD_Org_ID,Created,IsActive,AD_Client_ID) VALUES (10,'N',200007,200010,200009,'D','f765b061-046e-4b00-ad53-db41b8e1d268',100,100,TO_DATE('2014-03-18 14:46:13','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2014-03-18 14:46:13','YYYY-MM-DD HH24:MI:SS'),'N',0)
;
-- Mar 18, 2014 2:46:15 PM MYT
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Cost,YPosition,OverlapUnits,UnitsCycles,Yield,WaitTime,Priority,Duration,IsCentrallyMaintained,JoinElement,Limit,WorkingTime,XPosition,WaitingTime,IsMilestone,IsSubcontracting,SplitElement,Action,Description,Value,Name,AD_WF_Node_UU,DynPriorityChange,AD_Workflow_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,DocAction,AD_Client_ID,EntityType,AD_Org_ID) VALUES (200011,0,0,0,0,100,0,0,0,'Y','X',0,0,0,0,'N','N','X','Z','(Standard Node)','(Start)','(Start)','86125a0c-d0f4-4d26-8ebc-50455547cc87',0,200002,TO_DATE('2014-03-18 14:46:14','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-03-18 14:46:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','CO',0,'D',0)
;
-- Mar 18, 2014 2:46:16 PM MYT
INSERT INTO AD_WF_NodeNext (SeqNo,IsStdUserWorkflow,AD_WF_NodeNext_ID,AD_WF_Node_ID,AD_WF_Next_ID,EntityType,AD_WF_NodeNext_UU,UpdatedBy,CreatedBy,Updated,AD_Org_ID,Created,IsActive,AD_Client_ID) VALUES (100,'N',200008,200011,200008,'D','ef08df1e-2dd3-4a68-ae89-c8964c885d90',100,100,TO_DATE('2014-03-18 14:46:15','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2014-03-18 14:46:15','YYYY-MM-DD HH24:MI:SS'),'Y',0)
;
-- Mar 18, 2014 2:46:16 PM MYT
UPDATE AD_Workflow SET IsValid='Y', AD_WF_Node_ID=200011,Updated=TO_DATE('2014-03-18 14:46:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=200002
;
-- Mar 18, 2014 2:46:20 PM MYT
INSERT INTO AD_Process (CopyFromProcess,AD_Process_ID,IsDirectPrint,IsReport,AD_Process_UU,AccessLevel,IsBetaFunctionality,IsServerProcess,Statistic_Seconds,Statistic_Count,ShowHelp,EntityType,Name,AD_Workflow_ID,AD_Org_ID,Updated,UpdatedBy,Created,IsActive,CreatedBy,Value,AD_Client_ID) VALUES ('N',200068,'N','N','6ce10946-4f1c-4781-b03a-9da4c7a35faf','1','N','N',0,0,'Y','D','Process Production',200002,0,TO_DATE('2014-03-18 14:46:19','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-03-18 14:46:19','YYYY-MM-DD HH24:MI:SS'),'Y',100,'M_Production Process',0)
;
-- Mar 18, 2014 2:46:22 PM MYT
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AD_Process_ID) VALUES (0,'Y',0,210983,'N','N','N',0,'N',2,'N','N','N','Y','d94f85cc-ad66-4265-8f6b-6e5818ac0932','Y','DocAction','The targeted status of the document','CO','You find the current status in the Document Status field. The options are listed in a popup','Document Action','Y',TO_DATE('2014-03-18 14:46:21','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2014-03-18 14:46:21','YYYY-MM-DD HH24:MI:SS'),100,'Y','N',0,'D','N','N','N',287,28,135,325,200068)
;
-- Mar 18, 2014 2:46:24 PM MYT
ALTER TABLE M_Production ADD (DocAction CHAR(2) DEFAULT 'CO' NOT NULL)
;
-- Mar 18, 2014 2:46:29 PM MYT
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID) VALUES (0,'Y',0,210984,'N','N','N',0,'N',2,'N','N','N','Y','cd901157-2d1c-4fbf-a943-7e64d7f79361','Y','DocStatus','The current status of the document','DR','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','Document Status','Y',TO_DATE('2014-03-18 14:46:28','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2014-03-18 14:46:28','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N','N','N',289,17,131,325)
;
-- Mar 18, 2014 2:46:29 PM MYT
ALTER TABLE M_Production ADD (DocStatus VARCHAR2(2) DEFAULT 'DR' NOT NULL)
;
UPDATE M_Production set DocAction='CL', DocStatus='CO' WHERE IsCreated='Y' AND Processed='Y'
;
ALTER TABLE M_Production MODIFY M_Locator_ID NUMBER(10) DEFAULT NULL
;
ALTER TABLE M_Production MODIFY M_Product_ID NUMBER(10) DEFAULT NULL
;
ALTER TABLE M_ProductionLine MODIFY M_Production_ID NUMBER(10) DEFAULT NULL
;
-- Apr 14, 2014 3:19:08 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',319,0,'N','N',61943,220,'Y',202849,'N','The Create From process will create a new document based on information in an existing document selected by the user.','D','Process which will generate a new document lines based on an existing document','Create lines from','ee659ab5-c6b5-4057-a00d-f19b72977ca1','Y','N',100,0,TO_DATE('2014-04-14 15:19:02','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-04-14 15:19:02','YYYY-MM-DD HH24:MI:SS'),'Y','Y',220,2,'N',0,2,1,'N','N')
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=10,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3783
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=20,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3784
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=30,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3786
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=40,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3787
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=50,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3785
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=60,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3788
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=70,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7817
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=80,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7820
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=90,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7821
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=100,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7818
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=110,Updated=TO_DATE('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7822
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=120,Updated=TO_DATE('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7819
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=130,Updated=TO_DATE('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3790
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=140, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202849
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3791
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=160,Updated=TO_DATE('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3789
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3782
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202628
;
-- Apr 14, 2014 3:21:19 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',319,0,'N','N',210983,170,'Y',202850,'N','You find the current status in the Document Status field. The options are listed in a popup','D','The targeted status of the document','Document Action','1fc40e46-cfdf-48f1-88da-72e130c33c43','Y','N',100,0,TO_DATE('2014-04-14 15:21:13','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-04-14 15:21:13','YYYY-MM-DD HH24:MI:SS'),'Y','Y',230,2,'N',0,2,1,'N','N')
;
-- Apr 14, 2014 3:23:04 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',319,0,'N','N',210984,180,'Y',202851,'Y','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','D','The current status of the document','Document Status','38c5f024-275c-455e-9587-7c9d8da0b031','Y','N',100,0,TO_DATE('2014-04-14 15:22:58','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-04-14 15:22:58','YYYY-MM-DD HH24:MI:SS'),'Y','Y',240,4,'N',0,2,1,'N','N')
;
-- Apr 14, 2014 3:29:04 PM MYT
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=202850
;
-- Apr 14, 2014 3:29:04 PM MYT
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=202851
;
-- Apr 14, 2014 3:29:04 PM MYT
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 3:30:48 PM MYT
UPDATE AD_Column SET IsToolbarButton='N',Updated=TO_DATE('2014-04-14 15:30:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210983
;
-- Apr 14, 2014 3:35:45 PM MYT
UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2014-04-14 15:35:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59963
;
-- Apr 14, 2014 3:36:36 PM MYT
UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2014-04-14 15:36:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59962
;
-- Apr 14, 2014 3:38:30 PM MYT
UPDATE AD_Field SET IsMandatory='Y',Updated=TO_DATE('2014-04-14 15:38:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59752
;
-- Apr 14, 2014 3:38:48 PM MYT
UPDATE AD_Field SET IsMandatory='Y',Updated=TO_DATE('2014-04-14 15:38:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59743
;
-- Apr 14, 2014 3:41:35 PM MYT
UPDATE AD_Column SET AD_Reference_ID=20,Updated=TO_DATE('2014-04-14 15:41:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=61940
;
-- Apr 14, 2014 3:42:07 PM MYT
UPDATE AD_Field SET IsDisplayed='N',Updated=TO_DATE('2014-04-14 15:42:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62016
;
-- Apr 14, 2014 3:42:45 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',53344,0,'N','N',210983,120,'Y',202852,'N','You find the current status in the Document Status field. The options are listed in a popup','D','The targeted status of the document','Document Action','38c18801-8280-447b-a676-f979d35f0e9d','Y','N',100,0,TO_DATE('2014-04-14 15:42:38','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-04-14 15:42:38','YYYY-MM-DD HH24:MI:SS'),'Y','Y',130,2,'N',0,2,1,'N','N')
;
-- Apr 14, 2014 3:43:04 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',53344,0,'N','N',210984,260,'Y',202853,'Y','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','D','The current status of the document','Document Status','4dc496c8-6969-4c9d-b94f-63b876ce1999','Y','N',100,0,TO_DATE('2014-04-14 15:43:03','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-04-14 15:43:03','YYYY-MM-DD HH24:MI:SS'),'Y','Y',220,1,'N',0,1,1,'N','N')
;
-- Apr 14, 2014 3:43:10 PM MYT
UPDATE AD_Field SET XPosition=2, ColumnSpan=2,Updated=TO_DATE('2014-04-14 15:43:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202853
;
-- Apr 14, 2014 4:26:11 PM MYT
-- IDEMPIERE-1715 Implement revert action for Production (Single Product)
UPDATE AD_Field SET SeqNo=120, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59756
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=130,Updated=TO_DATE('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202852
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=230, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202853
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=240,Updated=TO_DATE('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59749
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=250,Updated=TO_DATE('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59748
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62016
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202629
;
-- Apr 14, 2014 4:27:56 PM MYT
UPDATE AD_Field SET SeqNo=70, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2014-04-14 16:27:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202849
;
-- Apr 14, 2014 4:27:56 PM MYT
UPDATE AD_Field SET SeqNo=80, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2014-04-14 16:27:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3791
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=90, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202850
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=100,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7817
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=110,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7820
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=120,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7821
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=130,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7818
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=140,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7822
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7819
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=160,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3790
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=170, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202851
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=180, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 4:28:14 PM MYT
UPDATE AD_Field SET AD_FieldGroup_ID=101,Updated=TO_DATE('2014-04-14 16:28:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202851
;
-- Apr 14, 2014 4:28:25 PM MYT
UPDATE AD_Field SET AD_FieldGroup_ID=101,Updated=TO_DATE('2014-04-14 16:28:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 4:29:31 PM MYT
UPDATE AD_Field SET AD_FieldGroup_ID=101,Updated=TO_DATE('2014-04-14 16:29:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202853
;
-- Apr 14, 2014 4:34:59 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus,EntityType) VALUES (0,'N',319,0,'N','N',59961,190,'Y',202854,'N','The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>".
If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).','Document sequence number of the document','Document No','d4f0dde6-f83a-4fa1-9645-b769c2fc9b0e','Y','N',100,0,TO_DATE('2014-04-14 16:34:53','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-04-14 16:34:53','YYYY-MM-DD HH24:MI:SS'),'Y','Y',250,1,'N',0,2,1,'N','N','D')
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=30, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202854
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=40,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3786
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=50,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3787
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=60,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3785
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=70,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3788
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=80,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202849
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=90,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3791
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=100,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202850
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=110,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7817
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=120,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7820
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=130,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7821
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=140,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7818
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7822
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=160,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7819
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=170,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3790
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=180,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202851
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=190, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 4:40:26 PM MYT
UPDATE AD_Window SET IsActive='N',Updated=TO_DATE('2014-04-14 16:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=191
;
-- Apr 14, 2014 4:40:26 PM MYT
UPDATE AD_Menu SET Name='Production', Description='Production based on Bill of Materials', IsActive='N',Updated=TO_DATE('2014-04-14 16:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=228
;
-- Apr 14, 2014 4:45:18 PM MYT
INSERT INTO AD_Reference (AD_Reference_ID,Name,EntityType,AD_Reference_UU,IsOrderByValue,ValidationType,AD_Org_ID,CreatedBy,Updated,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (200080,'M_Production','D','25b245ad-6b82-42c5-a1dd-bea8fb43556b','N','T',0,100,TO_DATE('2014-04-14 16:45:12','YYYY-MM-DD HH24:MI:SS'),'Y',TO_DATE('2014-04-14 16:45:12','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Apr 14, 2014 4:45:47 PM MYT
INSERT INTO AD_Ref_Table (IsValueDisplayed,AD_Ref_Table_UU,CreatedBy,Updated,Created,UpdatedBy,AD_Org_ID,IsActive,AD_Client_ID,EntityType,AD_Display,AD_Key,AD_Reference_ID,AD_Table_ID) VALUES ('N','ba10e596-5065-48e6-932c-337e19726661',100,TO_DATE('2014-04-14 16:45:47','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2014-04-14 16:45:47','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',0,'D',59961,3596,200080,325)
;
-- Apr 14, 2014 4:46:17 PM MYT
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,AD_Element_ID,AD_Reference_Value_ID,AD_Table_ID) VALUES (0,'N',1,211207,'N','N','N',0,'N',10,'N',18,'N','N','Y','e2c52b19-8de8-40cd-8738-283bd9f1f351','N','Reversal_ID','ID of document reversal','Reversal ID','Y',TO_DATE('2014-04-14 16:46:11','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2014-04-14 16:46:11','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N','N',53457,200080,325)
;
-- Apr 15, 2014 12:13:29 AM MYT
-- IDEMPIERE-1715 Implement revert action for Production (Single Product)
UPDATE AD_Column SET FKConstraintName='Reversal_MProduction', FKConstraintType='N',Updated=TO_DATE('2014-04-15 00:13:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211207
;
-- Apr 15, 2014 12:13:29 AM MYT
ALTER TABLE M_Production ADD Reversal_ID NUMBER(10) DEFAULT NULL
;
-- Apr 15, 2014 12:13:30 AM MYT
ALTER TABLE M_Production ADD CONSTRAINT Reversal_MProduction FOREIGN KEY (Reversal_ID) REFERENCES m_production(m_production_id) DEFERRABLE INITIALLY DEFERRED
;
-- Apr 15, 2014 12:14:43 AM MYT
UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2014-04-15 00:14:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59960
;
-- Apr 15, 2014 12:15:32 AM MYT
UPDATE AD_Field SET IsMandatory='Y',Updated=TO_DATE('2014-04-15 00:15:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59770
;
-- Apr 15, 2014 12:16:37 AM MYT
UPDATE AD_Field SET IsMandatory='Y',Updated=TO_DATE('2014-04-15 00:16:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3809
;
-- Apr 15, 2014 12:36:25 PM MYT
UPDATE AD_Column SET IsUpdateable='Y',Updated=TO_DATE('2014-04-15 12:36:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211207
;
SELECT register_migration_script('201404140708_IDEMPIERE-1750.sql') FROM dual
;

View File

@ -0,0 +1,420 @@
-- Mar 18, 2014 2:46:09 PM MYT
-- IDEMPIERE-1715 Production Document Action
INSERT INTO AD_Workflow (ValidateWorkflow,Cost,WaitingTime,WorkingTime,AccessLevel,Duration,DurationUnit,IsDefault,IsValid,"limit",Priority,PublishStatus,Version,SetupTime,QtyBatchSize,MovingTime,IsBetaFunctionality,OverlapUnits,UnitsCycles,Yield,QueuingTime,WorkflowType,Value,Name,AD_Workflow_UU,Author,DocumentNo,AD_Workflow_ID,UpdatedBy,Updated,Created,CreatedBy,IsActive,AD_Client_ID,EntityType,AD_Table_ID,AD_Org_ID) VALUES ('N',0,0,0,'1',0,'D','N','N',0,0,'R',0,0,1,0,'N',0,0,100,0,'P','Process_Production','Process_Production','cc9a6ab7-ff24-4c88-b35e-6a67dd76f405','iDempiere','10000000',200002,100,TO_TIMESTAMP('2014-03-18 14:46:07','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2014-03-18 14:46:07','YYYY-MM-DD HH24:MI:SS'),100,'Y',0,'D',325,0)
;
-- Mar 18, 2014 2:46:11 PM MYT
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Cost,YPosition,OverlapUnits,UnitsCycles,Yield,WaitTime,Priority,Duration,IsCentrallyMaintained,JoinElement,"limit",WorkingTime,XPosition,WaitingTime,IsMilestone,IsSubcontracting,SplitElement,"action",Description,Value,Name,AD_WF_Node_UU,DynPriorityChange,AD_Workflow_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,DocAction,AD_Client_ID,EntityType,AD_Org_ID) VALUES (200008,0,0,0,0,100,0,0,0,'Y','X',0,0,0,0,'N','N','X','D','(Standard Node)','(DocAuto)','(DocAuto)','a483ae3a-dc85-46e4-a384-a10e7ace85d2',0,200002,TO_TIMESTAMP('2014-03-18 14:46:10','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-03-18 14:46:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','--',0,'D',0)
;
-- Mar 18, 2014 2:46:12 PM MYT
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Cost,YPosition,OverlapUnits,UnitsCycles,Yield,WaitTime,Priority,Duration,IsCentrallyMaintained,JoinElement,"limit",WorkingTime,XPosition,WaitingTime,IsMilestone,IsSubcontracting,SplitElement,"action",Description,Value,Name,AD_WF_Node_UU,DynPriorityChange,AD_Workflow_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,DocAction,AD_Client_ID,EntityType,AD_Org_ID) VALUES (200009,0,0,0,0,100,0,0,0,'Y','X',0,0,0,0,'N','N','X','D','(Standard Node)','(DocComplete)','(DocComplete)','20f82106-add0-454b-8179-5328c1707720',0,200002,TO_TIMESTAMP('2014-03-18 14:46:11','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-03-18 14:46:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','CO',0,'D',0)
;
-- Mar 18, 2014 2:46:13 PM MYT
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Cost,YPosition,OverlapUnits,UnitsCycles,Yield,WaitTime,Priority,Duration,IsCentrallyMaintained,JoinElement,"limit",WorkingTime,XPosition,WaitingTime,IsMilestone,IsSubcontracting,SplitElement,"action",Description,Value,Name,AD_WF_Node_UU,DynPriorityChange,AD_Workflow_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,DocAction,AD_Client_ID,EntityType,AD_Org_ID) VALUES (200010,0,0,0,0,100,0,0,0,'Y','X',0,0,0,0,'N','N','X','D','(Standard Node)','(DocPrepare)','(DocPrepare)','011830f3-4834-4bb1-bebd-5e8d77ca8b5f',0,200002,TO_TIMESTAMP('2014-03-18 14:46:12','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-03-18 14:46:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','PR',0,'D',0)
;
-- Mar 18, 2014 2:46:14 PM MYT
INSERT INTO AD_WF_NodeNext (SeqNo,IsStdUserWorkflow,AD_WF_NodeNext_ID,AD_WF_Node_ID,AD_WF_Next_ID,EntityType,AD_WF_NodeNext_UU,UpdatedBy,CreatedBy,Updated,AD_Org_ID,Created,IsActive,AD_Client_ID) VALUES (10,'N',200007,200010,200009,'D','f765b061-046e-4b00-ad53-db41b8e1d268',100,100,TO_TIMESTAMP('2014-03-18 14:46:13','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2014-03-18 14:46:13','YYYY-MM-DD HH24:MI:SS'),'N',0)
;
-- Mar 18, 2014 2:46:15 PM MYT
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Cost,YPosition,OverlapUnits,UnitsCycles,Yield,WaitTime,Priority,Duration,IsCentrallyMaintained,JoinElement,"limit",WorkingTime,XPosition,WaitingTime,IsMilestone,IsSubcontracting,SplitElement,"action",Description,Value,Name,AD_WF_Node_UU,DynPriorityChange,AD_Workflow_ID,Created,CreatedBy,Updated,UpdatedBy,IsActive,DocAction,AD_Client_ID,EntityType,AD_Org_ID) VALUES (200011,0,0,0,0,100,0,0,0,'Y','X',0,0,0,0,'N','N','X','Z','(Standard Node)','(Start)','(Start)','86125a0c-d0f4-4d26-8ebc-50455547cc87',0,200002,TO_TIMESTAMP('2014-03-18 14:46:14','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-03-18 14:46:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','CO',0,'D',0)
;
-- Mar 18, 2014 2:46:16 PM MYT
INSERT INTO AD_WF_NodeNext (SeqNo,IsStdUserWorkflow,AD_WF_NodeNext_ID,AD_WF_Node_ID,AD_WF_Next_ID,EntityType,AD_WF_NodeNext_UU,UpdatedBy,CreatedBy,Updated,AD_Org_ID,Created,IsActive,AD_Client_ID) VALUES (100,'N',200008,200011,200008,'D','ef08df1e-2dd3-4a68-ae89-c8964c885d90',100,100,TO_TIMESTAMP('2014-03-18 14:46:15','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2014-03-18 14:46:15','YYYY-MM-DD HH24:MI:SS'),'Y',0)
;
-- Mar 18, 2014 2:46:16 PM MYT
UPDATE AD_Workflow SET IsValid='Y', AD_WF_Node_ID=200011,Updated=TO_TIMESTAMP('2014-03-18 14:46:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=200002
;
-- Mar 18, 2014 2:46:20 PM MYT
INSERT INTO AD_Process (CopyFromProcess,AD_Process_ID,IsDirectPrint,IsReport,AD_Process_UU,AccessLevel,IsBetaFunctionality,IsServerProcess,Statistic_Seconds,Statistic_Count,ShowHelp,EntityType,Name,AD_Workflow_ID,AD_Org_ID,Updated,UpdatedBy,Created,IsActive,CreatedBy,Value,AD_Client_ID) VALUES ('N',200068,'N','N','6ce10946-4f1c-4781-b03a-9da4c7a35faf','1','N','N',0,0,'Y','D','Process Production',200002,0,TO_TIMESTAMP('2014-03-18 14:46:19','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-03-18 14:46:19','YYYY-MM-DD HH24:MI:SS'),'Y',100,'M_Production Process',0)
;
-- Mar 18, 2014 2:46:22 PM MYT
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AD_Process_ID) VALUES (0,'Y',0,210983,'N','N','N',0,'N',2,'N','N','N','Y','d94f85cc-ad66-4265-8f6b-6e5818ac0932','Y','DocAction','The targeted status of the document','CO','You find the current status in the Document Status field. The options are listed in a popup','Document Action','Y',TO_TIMESTAMP('2014-03-18 14:46:21','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2014-03-18 14:46:21','YYYY-MM-DD HH24:MI:SS'),100,'Y','N',0,'D','N','N','N',287,28,135,325,200068)
;
-- Mar 18, 2014 2:46:24 PM MYT
ALTER TABLE M_Production ADD COLUMN DocAction CHAR(2) NOT NULL DEFAULT 'CO'
;
-- Mar 18, 2014 2:46:29 PM MYT
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID) VALUES (0,'Y',0,210984,'N','N','N',0,'N',2,'N','N','N','Y','cd901157-2d1c-4fbf-a943-7e64d7f79361','Y','DocStatus','The current status of the document','DR','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','Document Status','Y',TO_TIMESTAMP('2014-03-18 14:46:28','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2014-03-18 14:46:28','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N','N','N',289,17,131,325)
;
-- Mar 18, 2014 2:46:29 PM MYT
ALTER TABLE M_Production ADD COLUMN DocStatus VARCHAR(2) NOT NULL DEFAULT 'DR'
;
UPDATE M_Production set DocAction='CL', DocStatus='CO' WHERE IsCreated='Y' AND Processed='Y'
;
ALTER TABLE M_Production ALTER COLUMN M_Product_ID DROP NOT NULL
;
ALTER TABLE M_Production ALTER COLUMN M_Locator_ID DROP NOT NULL
;
ALTER TABLE M_ProductionLine ALTER COLUMN M_Production_ID DROP NOT NULL
;
-- Apr 14, 2014 3:19:08 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',319,0,'N','N',61943,220,'Y',202849,'N','The Create From process will create a new document based on information in an existing document selected by the user.','D','Process which will generate a new document lines based on an existing document','Create lines from','ee659ab5-c6b5-4057-a00d-f19b72977ca1','Y','N',100,0,TO_TIMESTAMP('2014-04-14 15:19:02','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-04-14 15:19:02','YYYY-MM-DD HH24:MI:SS'),'Y','Y',220,2,'N',0,2,1,'N','N')
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=10,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3783
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=20,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3784
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=30,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3786
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=40,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3787
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3785
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3788
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=70,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7817
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7820
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7821
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7818
;
-- Apr 14, 2014 3:20:05 PM MYT
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2014-04-14 15:20:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7822
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7819
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3790
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=140, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202849
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3791
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3789
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3782
;
-- Apr 14, 2014 3:20:06 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2014-04-14 15:20:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202628
;
-- Apr 14, 2014 3:21:19 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',319,0,'N','N',210983,170,'Y',202850,'N','You find the current status in the Document Status field. The options are listed in a popup','D','The targeted status of the document','Document Action','1fc40e46-cfdf-48f1-88da-72e130c33c43','Y','N',100,0,TO_TIMESTAMP('2014-04-14 15:21:13','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-04-14 15:21:13','YYYY-MM-DD HH24:MI:SS'),'Y','Y',230,2,'N',0,2,1,'N','N')
;
-- Apr 14, 2014 3:23:04 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',319,0,'N','N',210984,180,'Y',202851,'Y','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','D','The current status of the document','Document Status','38c5f024-275c-455e-9587-7c9d8da0b031','Y','N',100,0,TO_TIMESTAMP('2014-04-14 15:22:58','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-04-14 15:22:58','YYYY-MM-DD HH24:MI:SS'),'Y','Y',240,4,'N',0,2,1,'N','N')
;
-- Apr 14, 2014 3:29:04 PM MYT
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=202850
;
-- Apr 14, 2014 3:29:04 PM MYT
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=202851
;
-- Apr 14, 2014 3:29:04 PM MYT
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 3:30:48 PM MYT
UPDATE AD_Column SET IsToolbarButton='N',Updated=TO_TIMESTAMP('2014-04-14 15:30:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210983
;
-- Apr 14, 2014 3:35:45 PM MYT
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2014-04-14 15:35:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59963
;
-- Apr 14, 2014 3:36:36 PM MYT
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2014-04-14 15:36:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59962
;
-- Apr 14, 2014 3:38:30 PM MYT
UPDATE AD_Field SET IsMandatory='Y',Updated=TO_TIMESTAMP('2014-04-14 15:38:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59752
;
-- Apr 14, 2014 3:38:48 PM MYT
UPDATE AD_Field SET IsMandatory='Y',Updated=TO_TIMESTAMP('2014-04-14 15:38:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59743
;
-- Apr 14, 2014 3:41:35 PM MYT
UPDATE AD_Column SET AD_Reference_ID=20,Updated=TO_TIMESTAMP('2014-04-14 15:41:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=61940
;
-- Apr 14, 2014 3:42:07 PM MYT
UPDATE AD_Field SET IsDisplayed='N',Updated=TO_TIMESTAMP('2014-04-14 15:42:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62016
;
-- Apr 14, 2014 3:42:45 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',53344,0,'N','N',210983,120,'Y',202852,'N','You find the current status in the Document Status field. The options are listed in a popup','D','The targeted status of the document','Document Action','38c18801-8280-447b-a676-f979d35f0e9d','Y','N',100,0,TO_TIMESTAMP('2014-04-14 15:42:38','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-04-14 15:42:38','YYYY-MM-DD HH24:MI:SS'),'Y','Y',130,2,'N',0,2,1,'N','N')
;
-- Apr 14, 2014 3:43:04 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus) VALUES (0,'N',53344,0,'N','N',210984,260,'Y',202853,'Y','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','D','The current status of the document','Document Status','4dc496c8-6969-4c9d-b94f-63b876ce1999','Y','N',100,0,TO_TIMESTAMP('2014-04-14 15:43:03','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-04-14 15:43:03','YYYY-MM-DD HH24:MI:SS'),'Y','Y',220,1,'N',0,1,1,'N','N')
;
-- Apr 14, 2014 3:43:10 PM MYT
UPDATE AD_Field SET XPosition=2, ColumnSpan=2,Updated=TO_TIMESTAMP('2014-04-14 15:43:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202853
;
-- Apr 14, 2014 4:26:11 PM MYT
-- IDEMPIERE-1715 Implement revert action for Production (Single Product)
UPDATE AD_Field SET SeqNo=120, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59756
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202852
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=230, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202853
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=240,Updated=TO_TIMESTAMP('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59749
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=250,Updated=TO_TIMESTAMP('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59748
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62016
;
-- Apr 14, 2014 4:26:11 PM MYT
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2014-04-14 16:26:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202629
;
-- Apr 14, 2014 4:27:56 PM MYT
UPDATE AD_Field SET SeqNo=70, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2014-04-14 16:27:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202849
;
-- Apr 14, 2014 4:27:56 PM MYT
UPDATE AD_Field SET SeqNo=80, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2014-04-14 16:27:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3791
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=90, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202850
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7817
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7820
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7821
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7818
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7822
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7819
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3790
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=170, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202851
;
-- Apr 14, 2014 4:27:57 PM MYT
UPDATE AD_Field SET SeqNo=180, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2014-04-14 16:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 4:28:14 PM MYT
UPDATE AD_Field SET AD_FieldGroup_ID=101,Updated=TO_TIMESTAMP('2014-04-14 16:28:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202851
;
-- Apr 14, 2014 4:28:25 PM MYT
UPDATE AD_Field SET AD_FieldGroup_ID=101,Updated=TO_TIMESTAMP('2014-04-14 16:28:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 4:29:31 PM MYT
UPDATE AD_Field SET AD_FieldGroup_ID=101,Updated=TO_TIMESTAMP('2014-04-14 16:29:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202853
;
-- Apr 14, 2014 4:34:59 PM MYT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus,EntityType) VALUES (0,'N',319,0,'N','N',59961,190,'Y',202854,'N','The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>".
If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).','Document sequence number of the document','Document No','d4f0dde6-f83a-4fa1-9645-b769c2fc9b0e','Y','N',100,0,TO_TIMESTAMP('2014-04-14 16:34:53','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-04-14 16:34:53','YYYY-MM-DD HH24:MI:SS'),'Y','Y',250,1,'N',0,2,1,'N','N','D')
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=30, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202854
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=40,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3786
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3787
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3785
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=70,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3788
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202849
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3791
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202850
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7817
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7820
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7821
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7818
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7822
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7819
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3790
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202851
;
-- Apr 14, 2014 4:35:41 PM MYT
UPDATE AD_Field SET SeqNo=190, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2014-04-14 16:35:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5145
;
-- Apr 14, 2014 4:40:26 PM MYT
UPDATE AD_Window SET IsActive='N',Updated=TO_TIMESTAMP('2014-04-14 16:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=191
;
-- Apr 14, 2014 4:40:26 PM MYT
UPDATE AD_Menu SET Name='Production', Description='Production based on Bill of Materials', IsActive='N',Updated=TO_TIMESTAMP('2014-04-14 16:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=228
;
-- Apr 14, 2014 4:45:18 PM MYT
INSERT INTO AD_Reference (AD_Reference_ID,Name,EntityType,AD_Reference_UU,IsOrderByValue,ValidationType,AD_Org_ID,CreatedBy,Updated,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (200080,'M_Production','D','25b245ad-6b82-42c5-a1dd-bea8fb43556b','N','T',0,100,TO_TIMESTAMP('2014-04-14 16:45:12','YYYY-MM-DD HH24:MI:SS'),'Y',TO_TIMESTAMP('2014-04-14 16:45:12','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Apr 14, 2014 4:45:47 PM MYT
INSERT INTO AD_Ref_Table (IsValueDisplayed,AD_Ref_Table_UU,CreatedBy,Updated,Created,UpdatedBy,AD_Org_ID,IsActive,AD_Client_ID,EntityType,AD_Display,AD_Key,AD_Reference_ID,AD_Table_ID) VALUES ('N','ba10e596-5065-48e6-932c-337e19726661',100,TO_TIMESTAMP('2014-04-14 16:45:47','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2014-04-14 16:45:47','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',0,'D',59961,3596,200080,325)
;
-- Apr 14, 2014 4:46:17 PM MYT
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,AD_Element_ID,AD_Reference_Value_ID,AD_Table_ID) VALUES (0,'N',1,211207,'N','N','N',0,'N',10,'N',18,'N','N','Y','e2c52b19-8de8-40cd-8738-283bd9f1f351','N','Reversal_ID','ID of document reversal','Reversal ID','Y',TO_TIMESTAMP('2014-04-14 16:46:11','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2014-04-14 16:46:11','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N','N',53457,200080,325)
;
-- Apr 15, 2014 12:13:29 AM MYT
-- IDEMPIERE-1715 Implement revert action for Production (Single Product)
UPDATE AD_Column SET FKConstraintName='Reversal_MProduction', FKConstraintType='N',Updated=TO_TIMESTAMP('2014-04-15 00:13:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211207
;
-- Apr 15, 2014 12:13:29 AM MYT
ALTER TABLE M_Production ADD COLUMN Reversal_ID NUMERIC(10) DEFAULT NULL
;
-- Apr 15, 2014 12:13:30 AM MYT
ALTER TABLE M_Production ADD CONSTRAINT Reversal_MProduction FOREIGN KEY (Reversal_ID) REFERENCES m_production(m_production_id) DEFERRABLE INITIALLY DEFERRED
;
-- Apr 15, 2014 12:14:43 AM MYT
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2014-04-15 00:14:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=59960
;
-- Apr 15, 2014 12:15:32 AM MYT
UPDATE AD_Field SET IsMandatory='Y',Updated=TO_TIMESTAMP('2014-04-15 00:15:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=59770
;
-- Apr 15, 2014 12:16:37 AM MYT
UPDATE AD_Field SET IsMandatory='Y',Updated=TO_TIMESTAMP('2014-04-15 00:16:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3809
;
-- Apr 15, 2014 12:36:25 PM MYT
UPDATE AD_Column SET IsUpdateable='Y',Updated=TO_TIMESTAMP('2014-04-15 12:36:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211207
;
SELECT register_migration_script('201404140708_IDEMPIERE-1750.sql') FROM dual
;

View File

@ -326,7 +326,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess
// Verify ProductType
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("WHERE ProductType NOT IN ('E','I','R','S','A')")
.append(" AND I_IsImported<>'Y'").append(clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
if (no != 0)

View File

@ -4,16 +4,14 @@ import java.sql.Timestamp;
import java.util.List;
import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.I_M_ProductionPlan;
import org.compiere.model.MClient;
import org.compiere.model.MProduction;
import org.compiere.model.MProductionLine;
import org.compiere.model.MProductionPlan;
import org.compiere.model.Query;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.Env;
import org.compiere.util.Util;
import org.compiere.wf.MWorkflow;
/**
@ -28,7 +26,6 @@ public class ProductionProcess extends SvrProcess {
private int p_M_Production_ID=0;
private Timestamp p_MovementDate = null;
private MProduction m_production = null;
private boolean mustBeStocked = false; //not used
protected void prepare() {
@ -58,7 +55,7 @@ public class ProductionProcess extends SvrProcess {
throw new AdempiereUserError("Could not load production header");
try {
int processed = ProductionProcess.procesProduction(m_production, p_MovementDate, mustBeStocked);
int processed = ProductionProcess.procesProduction(m_production, p_MovementDate, false);
StringBuilder msgreturn = new StringBuilder("@Processed@ #").append(processed);
return msgreturn.toString();
} catch (Exception e) {
@ -68,66 +65,23 @@ public class ProductionProcess extends SvrProcess {
}
public static int procesProduction(MProduction production, Timestamp movementDate, boolean mustBeStocked) {
if ( production.getIsCreated().equals("N") )
throw new AdempiereUserError("Not created");
if ( production.isProcessed() )
throw new AdempiereUserError("Already processed");
if (movementDate != null)
production.setMovementDate(movementDate);
StringBuilder errors = new StringBuilder();
int processed = 0;
if (!production.isUseProductionPlan()) {
MProductionLine[] lines = production.getLines();
errors.append(processLines(production, lines, mustBeStocked));
if (errors.length() > 0) {
throw new AdempiereException(errors.toString());
}
processed = processed + lines.length;
ProcessInfo pi = MWorkflow.runDocumentActionWorkflow(production, "CO");
if (pi.isError()) {
throw new RuntimeException(pi.getSummary());
} else {
if (production.isUseProductionPlan()) {
Query planQuery = new Query(Env.getCtx(), I_M_ProductionPlan.Table_Name, "M_ProductionPlan.M_Production_ID=?", production.get_TrxName());
List<MProductionPlan> plans = planQuery.setParameters(production.getM_Production_ID()).list();
int linesCount = 0;
for(MProductionPlan plan : plans) {
MProductionLine[] lines = plan.getLines();
if (lines.length > 0) {
errors.append(processLines(production, lines, mustBeStocked));
if (errors.length() > 0) {
throw new AdempiereException(errors.toString());
linesCount += lines.length;
}
processed = processed + lines.length;
}
plan.setProcessed(true);
plan.saveEx();
}
}
production.setProcessed(true);
production.saveEx();
/* Immediate accounting */
if (MClient.isClientAccountingImmediate()) {
@SuppressWarnings("unused")
String ignoreError = DocumentEngine.postImmediate(Env.getCtx(), production.getAD_Client_ID(), production.get_Table_ID(), production.get_ID(), true, production.get_TrxName());
}
return processed;
}
protected static String processLines(MProduction production, MProductionLine[] lines, boolean mustBeStocked) {
StringBuilder errors = new StringBuilder();
for ( int i = 0; i<lines.length; i++) {
String error = lines[i].createTransactions(production.getMovementDate(), mustBeStocked);
if (!Util.isEmpty(error)) {
errors.append(error);
return linesCount;
} else {
lines[i].setProcessed( true );
lines[i].saveEx(production.get_TrxName());
}
return production.getLines().length;
}
return errors.toString();
}
}
}

View File

@ -19,6 +19,7 @@ package org.compiere.process;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.UnknownHostException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -38,7 +39,9 @@ import javax.mail.Part;
import javax.mail.Session;
import javax.mail.Store;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MAttachment;
import org.compiere.model.MColumn;
import org.compiere.model.MRequest;
import org.compiere.model.MUser;
import org.compiere.util.CLogMgt;
@ -54,6 +57,7 @@ import org.compiere.util.EMailAuthenticator;
public class RequestEMailProcessor extends SvrProcess
{
protected String p_IMAPHost = null;
protected int p_IMAPPort = 143;
protected String p_IMAPUser = null;
protected String p_IMAPPwd = null;
protected String p_RequestFolder = null;
@ -133,7 +137,20 @@ public class RequestEMailProcessor extends SvrProcess
*/
protected String doIt() throws Exception
{
int portStartIndex = p_IMAPHost.lastIndexOf(":");
if (portStartIndex > 0){
String strPort = p_IMAPHost.substring(portStartIndex + 1, p_IMAPHost.length());
p_IMAPHost = p_IMAPHost.substring(0, portStartIndex);
try{
p_IMAPPort = Integer.parseInt(strPort);
}catch (Exception ex){
throw new AdempiereException("Error format port : " + strPort);
}
}else if (p_IMAPHost.startsWith("imap.gmail.com")){
p_IMAPPort = 993;
}
if (log.isLoggable(Level.INFO)) log.info("doIt - IMAPHost=" + p_IMAPHost +
" IMAPPort=" + p_IMAPPort +
" IMAPUser=" + p_IMAPUser +
// " IMAPPwd=" + p_IMAPPwd +
" RequestFolder=" + p_RequestFolder +
@ -145,19 +162,25 @@ public class RequestEMailProcessor extends SvrProcess
getSession();
getStore();
processInBox();
} catch (MessagingException mailEx) {
if (mailEx.getNextException() != null && mailEx.getNextException() instanceof UnknownHostException){
throw new AdempiereException("Error host : " + mailEx.getMessage());
} else {
throw new AdempiereException("Error when make connect to email server : " + mailEx.getMessage());
}
catch (Exception e)
{
} catch (AdempiereException ae) {
throw ae;
}
catch (Exception e) {
log.log(Level.SEVERE, "processInBox", e);
}
throw e;
}finally {
// Cleanup
try
{
if (m_store.isConnected())
if ( m_store != null && m_store.isConnected())
m_store.close();
}
catch (Exception e)
{
} catch(Exception ex) {}
}
StringBuilder msgreturn = new StringBuilder("processInBox - Total=").append(noProcessed)
@ -178,13 +201,14 @@ public class RequestEMailProcessor extends SvrProcess
// Session
Properties props = System.getProperties();
props.put("mail.store.protocol", "smtp");
props.put("mail.transport.protocol", "smtp");
props.put("mail.store.protocol", "imap");
props.put("mail.transport.protocol", "imap");
props.put("mail.host", p_IMAPHost);
props.put("mail.smtp.auth","true");
props.put("mail.imap.port", p_IMAPPort);
EMailAuthenticator auth = new EMailAuthenticator (p_IMAPUser, p_IMAPPwd);
//
m_session = Session.getDefaultInstance(props, auth);
m_session = Session.getInstance(props, auth);
m_session.setDebug(CLogMgt.isLevelFinest());
if (log.isLoggable(Level.FINE)) log.fine("getSession - " + m_session);
return m_session;
@ -204,6 +228,9 @@ public class RequestEMailProcessor extends SvrProcess
throw new IllegalStateException("No Session");
// Get IMAP Store
if (p_IMAPHost.startsWith("imap.gmail.com"))
m_store = m_session.getStore("imaps");
else
m_store = m_session.getStore("imap");
// Connect
m_store.connect();
@ -227,7 +254,7 @@ public class RequestEMailProcessor extends SvrProcess
// Open Inbox
Folder inbox = folder.getFolder(p_InboxFolder);
if (!inbox.exists())
throw new IllegalStateException("No Inbox");
throw new AdempiereException ("Wrong inbox name : " + p_InboxFolder);
inbox.open(Folder.READ_WRITE);
if (log.isLoggable(Level.FINE)) log.fine("processInBox - " + inbox.getName()
+ "; Messages Total=" + inbox.getMessageCount()
@ -236,7 +263,7 @@ public class RequestEMailProcessor extends SvrProcess
// Open Request
Folder requestFolder = folder.getFolder(p_RequestFolder);
if (!requestFolder.exists() && !requestFolder.create(Folder.HOLDS_MESSAGES))
throw new IllegalStateException("Cannot create Request Folder");
throw new AdempiereException ("Cannot create request folder : " + p_RequestFolder);
requestFolder.open(Folder.READ_WRITE);
// Open Workflow
@ -248,7 +275,7 @@ public class RequestEMailProcessor extends SvrProcess
// Open Error
Folder errorFolder = folder.getFolder(p_ErrorFolder);
if (!errorFolder.exists() && !errorFolder.create(Folder.HOLDS_MESSAGES))
throw new IllegalStateException("Cannot create Error Folder");
throw new AdempiereException ("Cannot create Error Folder : " + p_ErrorFolder);
errorFolder.open(Folder.READ_WRITE);
// Messages
@ -284,6 +311,8 @@ public class RequestEMailProcessor extends SvrProcess
Message[] deleted = inbox.expunge();
noRequest++;
} else {
noError++;
}
} catch (Exception e) {
if (log.isLoggable(Level.INFO)) log.info("message " + hdrs[0] + " threw error");
@ -344,20 +373,27 @@ public class RequestEMailProcessor extends SvrProcess
}
// Message-ID as documentNo
String[] hdrs = msg.getHeader("Message-ID");
// set DocumentNo
int maxlen = MColumn.get(getCtx(), MRequest.Table_Name, MRequest.COLUMNNAME_DocumentNo).getFieldLength();
String documentNo = hdrs[0];
if (documentNo.startsWith("<") && documentNo.endsWith(">"))
documentNo = documentNo.substring(1, documentNo.length()-1);
if (documentNo.length() > maxlen)
documentNo = documentNo.substring(0,30);
// Review if the e-mail was already created, comparing Message-ID+From+body
int retValuedup = 0;
String sqldup = "select r_request_id from r_request "
+ "where ad_client_id = ? "
+ "and documentno = ? "
+ "and startdate = ?";
String sqldup = "SELECT R_Request_ID FROM R_Request "
+ "WHERE AD_Client_ID = ? "
+ "AND DocumentNo = ? "
+ "AND StartDate = ?";
PreparedStatement pstmtdup = null;
ResultSet rsdup = null;
try
{
pstmtdup = DB.prepareStatement (sqldup, null);
pstmtdup.setInt(1, getAD_Client_ID());
pstmtdup.setString(2, hdrs[0].substring(0,30));
pstmtdup.setString(2, documentNo);
pstmtdup.setTimestamp(3, new Timestamp(msg.getSentDate().getTime()));
rsdup = pstmtdup.executeQuery ();
if (rsdup.next ())
@ -436,8 +472,7 @@ public class RequestEMailProcessor extends SvrProcess
msgreq = new StringBuilder("FROM: ") .append(from[0].toString()).append("\n").append(getMessage(msg));
req.setResult(msgreq.toString());
// Message-ID as documentNo
if (hdrs != null)
req.setDocumentNo(hdrs[0].substring(0,30));
req.setDocumentNo(documentNo);
// Default request type for this process
if (R_RequestType_ID > 0)
@ -528,9 +563,8 @@ public class RequestEMailProcessor extends SvrProcess
String disposition = part.getDisposition();
if ((disposition != null) &&
((disposition.equals(Part.ATTACHMENT) ||
(disposition.equals(Part.INLINE))))) {
if ( disposition != null
&& (disposition.equalsIgnoreCase(Part.ATTACHMENT) || disposition.equalsIgnoreCase(Part.INLINE))) {
MAttachment attach = req.createAttachment();

View File

@ -12,6 +12,9 @@
</classpathentry>
<classpathentry exported="true" kind="lib" path="groovy-all-1.7.5.jar"/>
<classpathentry kind="lib" path="super-csv-2.0.0-beta-1.jar" sourcepath="/home/carlos/libsources/super-csv-2.0.0-beta-1-sources.jar"/>
<classpathentry kind="lib" path="bctsp-jdk14-1.38.jar"/>
<classpathentry kind="lib" path="bcmail-jdk14-1.38.jar"/>
<classpathentry kind="lib" path="bcprov-jdk14-1.38.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<accessrules>
<accessrule kind="accessible" pattern="com/sun/rowset/*"/>

View File

@ -18,7 +18,10 @@ Bundle-ClassPath: base.jar,
groovy-all-1.7.5.jar,
vt-dictionary-3.0.jar,
vt-password-3.1.1.jar,
super-csv-2.0.0-beta-1.jar
super-csv-2.0.0-beta-1.jar,
bctsp-jdk14-1.38.jar,
bcmail-jdk14-1.38.jar,
bcprov-jdk14-1.38.jar
Export-Package: bsh,
bsh.classpath,
bsh.collection,
@ -121,6 +124,87 @@ Export-Package: bsh,
org.adempiere.print.export,
org.adempiere.process,
org.adempiere.util,
org.bouncycastle,
org.bouncycastle.asn1,
org.bouncycastle.asn1.cmp,
org.bouncycastle.asn1.cms,
org.bouncycastle.asn1.crmf,
org.bouncycastle.asn1.cryptopro,
org.bouncycastle.asn1.esf,
org.bouncycastle.asn1.ess,
org.bouncycastle.asn1.gnu,
org.bouncycastle.asn1.iana,
org.bouncycastle.asn1.icao,
org.bouncycastle.asn1.isismtt,
org.bouncycastle.asn1.isismtt.ocsp,
org.bouncycastle.asn1.isismtt.x509,
org.bouncycastle.asn1.kisa,
org.bouncycastle.asn1.microsoft,
org.bouncycastle.asn1.misc,
org.bouncycastle.asn1.mozilla,
org.bouncycastle.asn1.nist,
org.bouncycastle.asn1.ntt,
org.bouncycastle.asn1.ocsp,
org.bouncycastle.asn1.oiw,
org.bouncycastle.asn1.pkcs,
org.bouncycastle.asn1.sec,
org.bouncycastle.asn1.smime,
org.bouncycastle.asn1.teletrust,
org.bouncycastle.asn1.tsp,
org.bouncycastle.asn1.util,
org.bouncycastle.asn1.x500,
org.bouncycastle.asn1.x509,
org.bouncycastle.asn1.x509.qualified,
org.bouncycastle.asn1.x509.sigi,
org.bouncycastle.asn1.x9,
org.bouncycastle.cms,
org.bouncycastle.crypto,
org.bouncycastle.crypto.agreement,
org.bouncycastle.crypto.agreement.kdf,
org.bouncycastle.crypto.digests,
org.bouncycastle.crypto.encodings,
org.bouncycastle.crypto.engines,
org.bouncycastle.crypto.examples,
org.bouncycastle.crypto.generators,
org.bouncycastle.crypto.io,
org.bouncycastle.crypto.macs,
org.bouncycastle.crypto.modes,
org.bouncycastle.crypto.paddings,
org.bouncycastle.crypto.params,
org.bouncycastle.crypto.prng,
org.bouncycastle.crypto.signers,
org.bouncycastle.crypto.tls,
org.bouncycastle.crypto.util,
org.bouncycastle.i18n,
org.bouncycastle.i18n.filter,
org.bouncycastle.jce,
org.bouncycastle.jce.examples,
org.bouncycastle.jce.exception,
org.bouncycastle.jce.interfaces,
org.bouncycastle.jce.netscape,
org.bouncycastle.jce.provider,
org.bouncycastle.jce.provider.symmetric,
org.bouncycastle.jce.spec,
org.bouncycastle.mail.smime,
org.bouncycastle.mail.smime.examples,
org.bouncycastle.mail.smime.handlers,
org.bouncycastle.mail.smime.util,
org.bouncycastle.mail.smime.validator,
org.bouncycastle.math.ec,
org.bouncycastle.mozilla,
org.bouncycastle.ocsp,
org.bouncycastle.openssl,
org.bouncycastle.sasn1,
org.bouncycastle.sasn1.cms,
org.bouncycastle.tsp,
org.bouncycastle.util,
org.bouncycastle.util.encoders,
org.bouncycastle.util.test,
org.bouncycastle.voms,
org.bouncycastle.x509,
org.bouncycastle.x509.examples,
org.bouncycastle.x509.extension,
org.bouncycastle.x509.util,
org.codehaus.groovy,
org.codehaus.groovy.ant,
org.codehaus.groovy.antlr,

View File

@ -33,7 +33,10 @@ bin.includes = META-INF/,\
OSGI-INF/defaultaddressvalidationfactory.xml,\
OSGI-INF/defaulttaxproviderfactory.xml,\
OSGI-INF/addressvalidationeventhandler.xml,\
schema/
schema/,\
bctsp-jdk14-1.38.jar,\
bcmail-jdk14-1.38.jar,\
bcprov-jdk14-1.38.jar
output.base.jar = build/
src.includes = schema/
source.base.jar = src/

View File

@ -924,6 +924,12 @@ public class GridTabCSVImporter implements IGridTabImporter
break;
}
}
}else if(isForeing && masterRecord==null && gridTab.getTabLevel()>0){
Object master =gridTab.getParentTab().getValue(foreignColumn);
if (master!=null && value!=null && !master.toString().equals(value)){
logMsg = header.get(i)+" - "+Msg.getMsg(Env.getCtx(),"DiffParentValue", new Object[] {master.toString(),value});
break;
}
}else if (masterRecord==null && isDetail){
MColumn column = MColumn.get(Env.getCtx(),field.getAD_Column_ID());
String foreignTable = column.getReferenceTableName();

View File

@ -36,6 +36,7 @@ import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Trx;
import org.compiere.util.ValueNamePair;
@ -91,6 +92,7 @@ public class UUIDGenerator extends SvrProcess {
while(rs.next()) {
int AD_Table_ID = rs.getInt(1);
String cTableName = rs.getString(2);
statusUpdate(Msg.getMsg(getCtx(), "Processing") + " " + cTableName);
String columnName = PO.getUUIDColumnName(cTableName);
int AD_Column_ID = DB.getSQLValue(null, "SELECT AD_Column_ID FROM AD_Column Where AD_Table_ID = ? AND ColumnName = ?", AD_Table_ID, columnName);

View File

@ -205,6 +205,32 @@ public interface I_M_Production
*/
public String getDescription();
/** Column name DocAction */
public static final String COLUMNNAME_DocAction = "DocAction";
/** Set Document Action.
* The targeted status of the document
*/
public void setDocAction (String DocAction);
/** Get Document Action.
* The targeted status of the document
*/
public String getDocAction();
/** Column name DocStatus */
public static final String COLUMNNAME_DocStatus = "DocStatus";
/** Set Document Status.
* The current status of the document
*/
public void setDocStatus (String DocStatus);
/** Get Document Status.
* The current status of the document
*/
public String getDocStatus();
/** Column name DocumentNo */
public static final String COLUMNNAME_DocumentNo = "DocumentNo";
@ -237,12 +263,12 @@ public interface I_M_Production
/** Set Complete.
* It is complete
*/
public void setIsComplete (String IsComplete);
public void setIsComplete (boolean IsComplete);
/** Get Complete.
* It is complete
*/
public String getIsComplete();
public boolean isComplete();
/** Column name IsCreated */
public static final String COLUMNNAME_IsCreated = "IsCreated";
@ -401,6 +427,21 @@ public interface I_M_Production
*/
public BigDecimal getProductionQty();
/** Column name Reversal_ID */
public static final String COLUMNNAME_Reversal_ID = "Reversal_ID";
/** Set Reversal ID.
* ID of document reversal
*/
public void setReversal_ID (int Reversal_ID);
/** Get Reversal ID.
* ID of document reversal
*/
public int getReversal_ID();
public org.compiere.model.I_M_Production getReversal() throws RuntimeException;
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
@ -420,12 +461,12 @@ public interface I_M_Production
/** Column name User1_ID */
public static final String COLUMNNAME_User1_ID = "User1_ID";
/** Set User List 1.
/** Set User Element List 1.
* User defined list element #1
*/
public void setUser1_ID (int User1_ID);
/** Get User List 1.
/** Get User Element List 1.
* User defined list element #1
*/
public int getUser1_ID();
@ -435,12 +476,12 @@ public interface I_M_Production
/** Column name User2_ID */
public static final String COLUMNNAME_User2_ID = "User2_ID";
/** Set User List 2.
/** Set User Element List 2.
* User defined list element #2
*/
public void setUser2_ID (int User2_ID);
/** Get User List 2.
/** Get User Element List 2.
* User defined list element #2
*/
public int getUser2_ID();

View File

@ -1706,6 +1706,10 @@ public class MInOut extends X_M_InOut implements DocAction
if ( isSOTrx() || !isDropShip() || getC_Order_ID() == 0 )
return null;
int linkedOrderID = new MOrder (getCtx(), getC_Order_ID(), get_TrxName()).getLink_Order_ID();
if (linkedOrderID <= 0)
return null;
// Document Type
int C_DocTypeTarget_ID = 0;
MDocType[] shipmentTypes = MDocType.getOfDocBaseType(getCtx(), MDocType.DOCBASETYPE_MaterialDelivery);
@ -1720,18 +1724,12 @@ public class MInOut extends X_M_InOut implements DocAction
MInOut dropShipment = copyFrom(this, getMovementDate(), getDateAcct(),
C_DocTypeTarget_ID, !isSOTrx(), false, get_TrxName(), true);
int linkedOrderID = new MOrder (getCtx(), getC_Order_ID(), get_TrxName()).getLink_Order_ID();
if (linkedOrderID != 0)
{
dropShipment.setC_Order_ID(linkedOrderID);
// get invoice id from linked order
int invID = new MOrder (getCtx(), linkedOrderID, get_TrxName()).getC_Invoice_ID();
if ( invID != 0 )
dropShipment.setC_Invoice_ID(invID);
}
else
return null;
dropShipment.setC_BPartner_ID(getDropShip_BPartner_ID());
dropShipment.setC_BPartner_Location_ID(getDropShip_Location_ID());

View File

@ -131,7 +131,7 @@ public class MInfoWindow extends X_AD_InfoWindow
Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName());
List<MInfoColumn> list = query.setParameters(getAD_InfoWindow_ID())
.setOnlyActiveRecords(true)
.setOrderBy(I_AD_InfoColumn.COLUMNNAME_SeqNo)
.setOrderBy("SeqNo, AD_InfoColumn_ID")
.list();
for(int i = list.size() - 1; i >= 0; i--) {
MInfoColumn infoColumn = list.get(i);
@ -145,7 +145,7 @@ public class MInfoWindow extends X_AD_InfoWindow
Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName());
List<MInfoColumn> list = query.setParameters(getAD_InfoWindow_ID())
.setOnlyActiveRecords(true)
.setOrderBy(I_AD_InfoColumn.COLUMNNAME_SeqNo)
.setOrderBy("SeqNo, AD_InfoColumn_ID")
.list();
return list.toArray(new MInfoColumn[0]);
}

View File

@ -575,7 +575,7 @@ public final class MLookup extends Lookup implements Serializable
if (m_info.ZoomWindowPO == 0 || query == null)
return m_info.ZoomWindow;
// Need to check SO/PO
boolean isSOTrx = DB.isSOTrx(m_info.TableName, query.getWhereClause(false));
boolean isSOTrx = DB.isSOTrx(m_info.TableName, query.getWhereClause(false), m_info.WindowNo);
//
return getZoom(isSOTrx);
} // getZoom

View File

@ -211,8 +211,7 @@ public class MPInstance extends X_AD_PInstance
MRole role = MRole.get(getCtx(), AD_Role_ID);
Boolean access = role.getProcessAccess(AD_Process_ID);
if (access == null || !access.booleanValue())
throw new IllegalAccessError("Cannot access Process " + AD_Process_ID
+ " with role: " + role.getName());
throw new IllegalAccessError(Msg.getMsg(getCtx(), "CannotAccessProcess", new Object[] {AD_Process_ID, role.getName()}));
}
super.setAD_Process_ID (AD_Process_ID);
} // setAD_Process_ID

View File

@ -1,19 +1,28 @@
package org.compiere.model;
import java.io.File;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.exceptions.PeriodClosedException;
import org.compiere.acct.Doc;
import org.compiere.process.DocAction;
import org.compiere.process.DocumentEngine;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Util;
public class MProduction extends X_M_Production {
public class MProduction extends X_M_Production implements DocAction {
/**
*
*/
@ -30,6 +39,10 @@ public class MProduction extends X_M_Production {
public MProduction(Properties ctx, int M_Production_ID, String trxName) {
super(ctx, M_Production_ID, trxName);
if (M_Production_ID == 0) {
setDocStatus(DOCSTATUS_Drafted);
setDocAction (DOCACTION_Prepare);
}
}
public MProduction(Properties ctx, ResultSet rs, String trxName) {
@ -43,6 +56,65 @@ public class MProduction extends X_M_Production {
setMovementDate( line.getDatePromised() );
}
@Override
public String completeIt()
{
// Re-Check
if (!m_justPrepared)
{
String status = prepareIt();
if (!DocAction.STATUS_InProgress.equals(status))
return status;
}
StringBuilder errors = new StringBuilder();
int processed = 0;
if (!isUseProductionPlan()) {
MProductionLine[] lines = getLines();
errors.append(processLines(lines));
if (errors.length() > 0) {
m_processMsg = errors.toString();
return DocAction.STATUS_Invalid;
}
processed = processed + lines.length;
} else {
Query planQuery = new Query(Env.getCtx(), I_M_ProductionPlan.Table_Name, "M_ProductionPlan.M_Production_ID=?", get_TrxName());
List<MProductionPlan> plans = planQuery.setParameters(getM_Production_ID()).list();
for(MProductionPlan plan : plans) {
MProductionLine[] lines = plan.getLines();
if (lines.length > 0) {
errors.append(processLines(lines));
if (errors.length() > 0) {
m_processMsg = errors.toString();
return DocAction.STATUS_Invalid;
}
processed = processed + lines.length;
}
plan.setProcessed(true);
plan.saveEx();
}
}
setProcessed(true);
setDocAction(DOCACTION_Close);
return DocAction.STATUS_Completed;
}
private Object processLines(MProductionLine[] lines) {
StringBuilder errors = new StringBuilder();
for ( int i = 0; i<lines.length; i++) {
String error = lines[i].createTransactions(getMovementDate(), false);
if (!Util.isEmpty(error)) {
errors.append(error);
} else {
lines[i].setProcessed( true );
lines[i].saveEx(get_TrxName());
}
}
return errors.toString();
}
public MProductionLine[] getLines() {
@ -310,6 +382,420 @@ public class MProduction extends X_M_Production {
return true;
}
@Override
public boolean processIt(String processAction) {
m_processMsg = null;
DocumentEngine engine = new DocumentEngine (this, getDocStatus());
return engine.processIt (processAction, getDocAction());
}
/** Process Message */
private String m_processMsg = null;
/** Just Prepared Flag */
private boolean m_justPrepared = false;
@Override
public boolean unlockIt() {
if (log.isLoggable(Level.INFO)) log.info("unlockIt - " + toString());
setProcessing(false);
return true;
}
@Override
public boolean invalidateIt() {
if (log.isLoggable(Level.INFO)) log.info(toString());
setDocAction(DOCACTION_Prepare);
return true;
}
@Override
public String prepareIt() {
if (log.isLoggable(Level.INFO)) log.info(toString());
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);
if (m_processMsg != null)
return DocAction.STATUS_Invalid;
if ( getIsCreated().equals("N") )
{
m_processMsg = "Not created";
return DocAction.STATUS_Invalid;
}
if (!isUseProductionPlan()) {
m_processMsg = validateEndProduct(getM_Product_ID());
if (!Util.isEmpty(m_processMsg)) {
return DocAction.STATUS_Invalid;
}
} else {
Query planQuery = new Query(getCtx(), I_M_ProductionPlan.Table_Name, "M_ProductionPlan.M_Production_ID=?", get_TrxName());
List<MProductionPlan> plans = planQuery.setParameters(getM_Production_ID()).list();
for(MProductionPlan plan : plans) {
m_processMsg = validateEndProduct(plan.getM_Product_ID());
if (!Util.isEmpty(m_processMsg)) {
return DocAction.STATUS_Invalid;
}
}
}
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
if (m_processMsg != null)
return DocAction.STATUS_Invalid;
m_justPrepared = true;
if (!DOCACTION_Complete.equals(getDocAction()))
setDocAction(DOCACTION_Complete);
return DocAction.STATUS_InProgress;
}
protected String validateEndProduct(int M_Product_ID) {
String msg = isBom(M_Product_ID);
if (!Util.isEmpty(msg))
return msg;
if (!costsOK(M_Product_ID)) {
msg = "Excessive difference in standard costs";
if (MSysConfig.getBooleanValue("MFG_ValidateCostsDifferenceOnCreate", false, getAD_Client_ID())) {
return msg;
} else {
log.warning(msg);
}
}
return null;
}
protected String isBom(int M_Product_ID)
{
String bom = DB.getSQLValueString(get_TrxName(), "SELECT isbom FROM M_Product WHERE M_Product_ID = ?", M_Product_ID);
if ("N".compareTo(bom) == 0)
{
return "Attempt to create product line for Non Bill Of Materials";
}
int materials = DB.getSQLValue(get_TrxName(), "SELECT count(M_Product_BOM_ID) FROM M_Product_BOM WHERE M_Product_ID = ?", M_Product_ID);
if (materials == 0)
{
return "Attempt to create product line for Bill Of Materials with no BOM Products";
}
return null;
}
protected boolean costsOK(int M_Product_ID) throws AdempiereUserError {
MProduct product = MProduct.get(getCtx(), M_Product_ID);
String costingMethod=product.getCostingMethod(MClient.get(getCtx()).getAcctSchema());
// will not work if non-standard costing is used
if (MAcctSchema.COSTINGMETHOD_StandardCosting.equals(costingMethod))
{
String sql = "SELECT ABS(((cc.currentcostprice-(SELECT SUM(c.currentcostprice*bom.bomqty)"
+ " FROM m_cost c"
+ " INNER JOIN m_product_bom bom ON (c.m_product_id=bom.m_productbom_id)"
+ " INNER JOIN m_costelement ce ON (c.m_costelement_id = ce.m_costelement_id AND ce.costingmethod = 'S')"
+ " WHERE bom.m_product_id = pp.m_product_id)"
+ " )/cc.currentcostprice))"
+ " FROM m_product pp"
+ " INNER JOIN m_cost cc on (cc.m_product_id=pp.m_product_id)"
+ " INNER JOIN m_costelement ce ON (cc.m_costelement_id=ce.m_costelement_id)"
+ " WHERE cc.currentcostprice > 0 AND pp.M_Product_ID = ?"
+ " AND ce.costingmethod='S'";
BigDecimal costPercentageDiff = DB.getSQLValueBD(get_TrxName(), sql, M_Product_ID);
if (costPercentageDiff == null)
{
costPercentageDiff = Env.ZERO;
String msg = "Could not retrieve costs";
if (MSysConfig.getBooleanValue("MFG_ValidateCostsOnCreate", false, getAD_Client_ID())) {
throw new AdempiereUserError(msg);
} else {
log.warning(msg);
}
}
if ( (costPercentageDiff.compareTo(new BigDecimal("0.005")))< 0 )
return true;
return false;
}
return true;
}
@Override
public boolean approveIt() {
return true;
}
@Override
public boolean rejectIt() {
return true;
}
@Override
public boolean voidIt() {
if (DOCSTATUS_Closed.equals(getDocStatus())
|| DOCSTATUS_Reversed.equals(getDocStatus())
|| DOCSTATUS_Voided.equals(getDocStatus()))
{
m_processMsg = "Document Closed: " + getDocStatus();
setDocAction(DOCACTION_None);
return false;
}
// Not Processed
if (DOCSTATUS_Drafted.equals(getDocStatus())
|| DOCSTATUS_Invalid.equals(getDocStatus())
|| DOCSTATUS_InProgress.equals(getDocStatus())
|| DOCSTATUS_Approved.equals(getDocStatus())
|| DOCSTATUS_NotApproved.equals(getDocStatus()) )
{
setIsCreated("N");
if (!isUseProductionPlan()) {
deleteLines(get_TrxName());
setProductionQty(BigDecimal.ZERO);
} else {
Query planQuery = new Query(Env.getCtx(), I_M_ProductionPlan.Table_Name, "M_ProductionPlan.M_Production_ID=?", get_TrxName());
List<MProductionPlan> plans = planQuery.setParameters(getM_Production_ID()).list();
for(MProductionPlan plan : plans) {
plan.deleteLines(get_TrxName());
plan.setProductionQty(BigDecimal.ZERO);
plan.setProcessed(true);
plan.saveEx();
}
}
}
else
{
boolean accrual = false;
try
{
MPeriod.testPeriodOpen(getCtx(), getMovementDate(), Doc.DOCTYPE_MatProduction, getAD_Org_ID());
}
catch (PeriodClosedException e)
{
accrual = true;
}
if (accrual)
return reverseAccrualIt();
else
return reverseCorrectIt();
}
setProcessed(true);
setDocAction(DOCACTION_None);
return true;
}
@Override
public boolean closeIt() {
if (log.isLoggable(Level.INFO)) log.info(toString());
// Before Close
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
if (m_processMsg != null)
return false;
setProcessed(true);
setDocAction(DOCACTION_None);
// After Close
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
if (m_processMsg != null)
return false;
return true;
}
@Override
public boolean reverseCorrectIt()
{
if (log.isLoggable(Level.INFO)) log.info(toString());
// Before reverseCorrect
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
if (m_processMsg != null)
return false;
MProduction reversal = reverse(false);
if (reversal == null)
return false;
// After reverseCorrect
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
if (m_processMsg != null)
return false;
m_processMsg = reversal.getDocumentNo();
return true;
}
private MProduction reverse(boolean accrual) {
Timestamp reversalDate = accrual ? Env.getContextAsDate(getCtx(), "#Date") : getMovementDate();
if (reversalDate == null) {
reversalDate = new Timestamp(System.currentTimeMillis());
}
MPeriod.testPeriodOpen(getCtx(), reversalDate, Doc.DOCTYPE_MatProduction, getAD_Org_ID());
MProduction reversal = null;
reversal = copyFrom (reversalDate);
StringBuilder msgadd = new StringBuilder("{->").append(getDocumentNo()).append(")");
reversal.addDescription(msgadd.toString());
reversal.setReversal_ID(getM_Production_ID());
reversal.saveEx(get_TrxName());
if (!reversal.processIt(DocAction.ACTION_Complete))
{
m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg();
return null;
}
reversal.closeIt();
reversal.setProcessing (false);
reversal.setDocStatus(DOCSTATUS_Reversed);
reversal.setDocAction(DOCACTION_None);
reversal.saveEx(get_TrxName());
msgadd = new StringBuilder("(").append(reversal.getDocumentNo()).append("<-)");
addDescription(msgadd.toString());
setProcessed(true);
setReversal_ID(reversal.getM_Production_ID());
setDocStatus(DOCSTATUS_Reversed); // may come from void
setDocAction(DOCACTION_None);
return reversal;
}
private MProduction copyFrom(Timestamp reversalDate) {
MProduction to = new MProduction(getCtx(), 0, get_TrxName());
PO.copyValues (this, to, getAD_Client_ID(), getAD_Org_ID());
to.set_ValueNoCheck ("DocumentNo", null);
//
to.setDocStatus (DOCSTATUS_Drafted); // Draft
to.setDocAction(DOCACTION_Complete);
to.setMovementDate(reversalDate);
to.setIsComplete(false);
to.setIsCreated("Y");
to.setProcessing(false);
to.setProcessed(false);
to.setIsUseProductionPlan(isUseProductionPlan());
if (isUseProductionPlan()) {
to.saveEx();
Query planQuery = new Query(Env.getCtx(), I_M_ProductionPlan.Table_Name, "M_ProductionPlan.M_Production_ID=?", get_TrxName());
List<MProductionPlan> fplans = planQuery.setParameters(getM_Production_ID()).list();
for(MProductionPlan fplan : fplans) {
MProductionPlan tplan = new MProductionPlan(getCtx(), 0, get_TrxName());
PO.copyValues (fplan, tplan, getAD_Client_ID(), getAD_Org_ID());
tplan.setM_Production_ID(to.getM_Production_ID());
tplan.setProductionQty(fplan.getProductionQty().negate());
tplan.setProcessed(false);
tplan.saveEx();
MProductionLine[] flines = fplan.getLines();
for(MProductionLine fline : flines) {
MProductionLine tline = new MProductionLine(tplan);
PO.copyValues (fline, tline, getAD_Client_ID(), getAD_Org_ID());
tline.setM_ProductionPlan_ID(tplan.getM_ProductionPlan_ID());
tline.setMovementQty(fline.getMovementQty().negate());
tline.setPlannedQty(fline.getPlannedQty().negate());
tline.setQtyUsed(fline.getQtyUsed().negate());
tline.saveEx();
}
}
} else {
to.setProductionQty(getProductionQty().negate());
to.saveEx();
MProductionLine[] flines = getLines();
for(MProductionLine fline : flines) {
MProductionLine tline = new MProductionLine(to);
PO.copyValues (fline, tline, getAD_Client_ID(), getAD_Org_ID());
tline.setM_Production_ID(to.getM_Production_ID());
tline.setMovementQty(fline.getMovementQty().negate());
tline.setPlannedQty(fline.getPlannedQty().negate());
tline.setQtyUsed(fline.getQtyUsed().negate());
tline.saveEx();
}
}
return to;
}
/**
* Add to Description
* @param description text
*/
public void addDescription (String description)
{
String desc = getDescription();
if (desc == null)
setDescription(description);
else{
StringBuilder msgd = new StringBuilder(desc).append(" | ").append(description);
setDescription(msgd.toString());
}
} // addDescription
@Override
public boolean reverseAccrualIt() {
if (log.isLoggable(Level.INFO)) log.info(toString());
// Before reverseCorrect
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
if (m_processMsg != null)
return false;
MProduction reversal = reverse(true);
if (reversal == null)
return false;
// After reverseCorrect
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
if (m_processMsg != null)
return false;
m_processMsg = reversal.getDocumentNo();
return true;
}
@Override
public boolean reActivateIt() {
throw new UnsupportedOperationException();
}
@Override
public String getSummary() {
return getDocumentNo();
}
@Override
public String getDocumentInfo() {
return getDocumentNo();
}
@Override
public File createPDF() {
return null;
}
@Override
public String getProcessMsg() {
return m_processMsg;
}
@Override
public int getDoc_User_ID() {
return getCreatedBy();
}
@Override
public int getC_Currency_ID() {
return MClient.get(getCtx()).getC_Currency_ID();
}
@Override
public BigDecimal getApprovalAmt() {
return BigDecimal.ZERO;
}
@Override
protected boolean beforeSave(boolean newRecord) {
if (getM_Product_ID() > 0) {

View File

@ -2581,14 +2581,17 @@ public final class MRole extends X_AD_Role
while (rs.next()) {
String op = rs.getString(1);
String active=rs.getString(2);
if ("N".equals(active) && validOptions.contains(op)) {
if ("N".equals(active)) {
if (validOptions.contains(op)) {
validOptions.remove(op);
}
} else {
if (!validOptions.contains(op))
if (!validOptions.contains(op)) {
validOptions.add(op);
}
}
}
}
validOptions.toArray(options);
} catch (SQLException e) {

View File

@ -926,7 +926,7 @@ public class MUser extends X_AD_User
}
}
if (newRecord || is_ValueChanged("Password")) {
if (getPassword() != null && getPassword().length() > 0 && (newRecord || is_ValueChanged("Password"))) {
// Validate password policies / IDEMPIERE-221
if (get_ValueOld("Salt") == null && get_Value("Salt") != null) { // being hashed
;

View File

@ -33,7 +33,7 @@ public class X_M_Production extends PO implements I_M_Production, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20140212L;
private static final long serialVersionUID = 20140416L;
/** Standard Constructor */
public X_M_Production (Properties ctx, int M_Production_ID, String trxName)
@ -46,10 +46,8 @@ public class X_M_Production extends PO implements I_M_Production, I_Persistent
// N
setIsUseProductionPlan (false);
// N
setM_Locator_ID (0);
setMovementDate (new Timestamp( System.currentTimeMillis() ));
// @#Date@
setM_Product_ID (0);
setM_Production_ID (0);
setPosted (false);
setProcessed (false);
@ -300,6 +298,98 @@ public class X_M_Production extends PO implements I_M_Production, I_Persistent
return (String)get_Value(COLUMNNAME_Description);
}
/** DocAction AD_Reference_ID=135 */
public static final int DOCACTION_AD_Reference_ID=135;
/** Complete = CO */
public static final String DOCACTION_Complete = "CO";
/** Approve = AP */
public static final String DOCACTION_Approve = "AP";
/** Reject = RJ */
public static final String DOCACTION_Reject = "RJ";
/** Post = PO */
public static final String DOCACTION_Post = "PO";
/** Void = VO */
public static final String DOCACTION_Void = "VO";
/** Close = CL */
public static final String DOCACTION_Close = "CL";
/** Reverse - Correct = RC */
public static final String DOCACTION_Reverse_Correct = "RC";
/** Reverse - Accrual = RA */
public static final String DOCACTION_Reverse_Accrual = "RA";
/** Invalidate = IN */
public static final String DOCACTION_Invalidate = "IN";
/** Re-activate = RE */
public static final String DOCACTION_Re_Activate = "RE";
/** <None> = -- */
public static final String DOCACTION_None = "--";
/** Prepare = PR */
public static final String DOCACTION_Prepare = "PR";
/** Unlock = XL */
public static final String DOCACTION_Unlock = "XL";
/** Wait Complete = WC */
public static final String DOCACTION_WaitComplete = "WC";
/** Set Document Action.
@param DocAction
The targeted status of the document
*/
public void setDocAction (String DocAction)
{
set_Value (COLUMNNAME_DocAction, DocAction);
}
/** Get Document Action.
@return The targeted status of the document
*/
public String getDocAction ()
{
return (String)get_Value(COLUMNNAME_DocAction);
}
/** DocStatus AD_Reference_ID=131 */
public static final int DOCSTATUS_AD_Reference_ID=131;
/** Drafted = DR */
public static final String DOCSTATUS_Drafted = "DR";
/** Completed = CO */
public static final String DOCSTATUS_Completed = "CO";
/** Approved = AP */
public static final String DOCSTATUS_Approved = "AP";
/** Not Approved = NA */
public static final String DOCSTATUS_NotApproved = "NA";
/** Voided = VO */
public static final String DOCSTATUS_Voided = "VO";
/** Invalid = IN */
public static final String DOCSTATUS_Invalid = "IN";
/** Reversed = RE */
public static final String DOCSTATUS_Reversed = "RE";
/** Closed = CL */
public static final String DOCSTATUS_Closed = "CL";
/** Unknown = ?? */
public static final String DOCSTATUS_Unknown = "??";
/** In Progress = IP */
public static final String DOCSTATUS_InProgress = "IP";
/** Waiting Payment = WP */
public static final String DOCSTATUS_WaitingPayment = "WP";
/** Waiting Confirmation = WC */
public static final String DOCSTATUS_WaitingConfirmation = "WC";
/** Set Document Status.
@param DocStatus
The current status of the document
*/
public void setDocStatus (String DocStatus)
{
set_Value (COLUMNNAME_DocStatus, DocStatus);
}
/** Get Document Status.
@return The current status of the document
*/
public String getDocStatus ()
{
return (String)get_Value(COLUMNNAME_DocStatus);
}
/** Set Document No.
@param DocumentNo
Document sequence number of the document
@ -329,17 +419,24 @@ public class X_M_Production extends PO implements I_M_Production, I_Persistent
@param IsComplete
It is complete
*/
public void setIsComplete (String IsComplete)
public void setIsComplete (boolean IsComplete)
{
set_Value (COLUMNNAME_IsComplete, IsComplete);
set_Value (COLUMNNAME_IsComplete, Boolean.valueOf(IsComplete));
}
/** Get Complete.
@return It is complete
*/
public String getIsComplete ()
public boolean isComplete ()
{
return (String)get_Value(COLUMNNAME_IsComplete);
Object oo = get_Value(COLUMNNAME_IsComplete);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** IsCreated AD_Reference_ID=319 */
@ -620,12 +717,40 @@ public class X_M_Production extends PO implements I_M_Production, I_Persistent
return bd;
}
public org.compiere.model.I_M_Production getReversal() throws RuntimeException
{
return (org.compiere.model.I_M_Production)MTable.get(getCtx(), org.compiere.model.I_M_Production.Table_Name)
.getPO(getReversal_ID(), get_TrxName()); }
/** Set Reversal ID.
@param Reversal_ID
ID of document reversal
*/
public void setReversal_ID (int Reversal_ID)
{
if (Reversal_ID < 1)
set_Value (COLUMNNAME_Reversal_ID, null);
else
set_Value (COLUMNNAME_Reversal_ID, Integer.valueOf(Reversal_ID));
}
/** Get Reversal ID.
@return ID of document reversal
*/
public int getReversal_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Reversal_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException
{
return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getUser1_ID(), get_TrxName()); }
/** Set User List 1.
/** Set User Element List 1.
@param User1_ID
User defined list element #1
*/
@ -637,7 +762,7 @@ public class X_M_Production extends PO implements I_M_Production, I_Persistent
set_Value (COLUMNNAME_User1_ID, Integer.valueOf(User1_ID));
}
/** Get User List 1.
/** Get User Element List 1.
@return User defined list element #1
*/
public int getUser1_ID ()
@ -653,7 +778,7 @@ public class X_M_Production extends PO implements I_M_Production, I_Persistent
return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getUser2_ID(), get_TrxName()); }
/** Set User List 2.
/** Set User Element List 2.
@param User2_ID
User defined list element #2
*/
@ -665,7 +790,7 @@ public class X_M_Production extends PO implements I_M_Production, I_Persistent
set_Value (COLUMNNAME_User2_ID, Integer.valueOf(User2_ID));
}
/** Get User List 2.
/** Get User Element List 2.
@return User defined list element #2
*/
public int getUser2_ID ()

View File

@ -41,6 +41,7 @@ import org.compiere.model.MJournalBatch;
import org.compiere.model.MMovement;
import org.compiere.model.MOrder;
import org.compiere.model.MPayment;
import org.compiere.model.MProduction;
import org.compiere.model.MRMA;
import org.compiere.model.MRole;
import org.compiere.model.MTable;
@ -1112,6 +1113,27 @@ public class DocumentEngine implements DocAction
options[index++] = DocumentEngine.ACTION_ReActivate;
}
}
/********************
* Production
*/
else if (AD_Table_ID == MProduction.Table_ID)
{
// Draft .. DR/IP/IN
if (docStatus.equals(DocumentEngine.STATUS_Drafted)
|| docStatus.equals(DocumentEngine.STATUS_InProgress)
|| docStatus.equals(DocumentEngine.STATUS_Invalid))
{
options[index++] = DocumentEngine.ACTION_Prepare;
}
// Complete .. CO
else if (docStatus.equals(DocumentEngine.STATUS_Completed))
{
options[index++] = DocumentEngine.ACTION_Void;
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
}
}
/********************
* Manufacturing Cost Collector
*/

View File

@ -25,6 +25,7 @@ import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
@ -1695,9 +1696,10 @@ public final class DB
* Assumes Sales Order. Queries IsSOTrx of table with where clause
* @param TableName table
* @param whereClause where clause
* @param windowNo
* @return true (default) or false if tested that not SO
*/
public static boolean isSOTrx (String TableName, String whereClause)
public static boolean isSOTrx (String TableName, String whereClause, int windowNo)
{
if (TableName == null || TableName.length() == 0)
{
@ -1710,7 +1712,7 @@ public final class DB
return true;
}
//
boolean isSOTrx = true;
Boolean isSOTrx = null;
boolean noIsSOTrxColumn = false;
if (MTable.get(Env.getCtx(), TableName).getColumn("IsSOTrx") == null) {
noIsSOTrxColumn = true;
@ -1724,7 +1726,7 @@ public final class DB
pstmt = DB.prepareStatement (sql, null);
rs = pstmt.executeQuery ();
if (rs.next ())
isSOTrx = "Y".equals(rs.getString(1));
isSOTrx = Boolean.valueOf("Y".equals(rs.getString(1)));
}
catch (Exception e)
{
@ -1754,7 +1756,7 @@ public final class DB
pstmt2 = DB.prepareStatement (sql, null);
rs2 = pstmt2.executeQuery ();
if (rs2.next ())
isSOTrx = "Y".equals(rs2.getString(1));
isSOTrx = Boolean.valueOf("Y".equals(rs2.getString(1)));
}
catch (Exception ee)
{
@ -1770,9 +1772,20 @@ public final class DB
}
if (noIsSOTrxColumn)
if (log.isLoggable(Level.FINEST))log.log(Level.FINEST, TableName + " - No SOTrx");
return isSOTrx;
if (isSOTrx == null) {
if (windowNo >= 0) {
// check context
isSOTrx = Boolean.valueOf("Y".equals(Env.getContext(Env.getCtx(), windowNo, "IsSOTrx")));
} else {
isSOTrx = Boolean.TRUE;
}
}
return isSOTrx.booleanValue();
} // isSOTrx
public static boolean isSOTrx (String TableName, String whereClause) {
return isSOTrx (TableName, whereClause, -1);
}
/**************************************************************************
* Get next number for Key column = 0 is Error.
@ -2361,4 +2374,92 @@ public final class DB
}
return false;
}
/**
* Get an array of objects from sql (one per each column on the select clause), column indexing starts with 0
* @param trxName trx
* @param sql sql
* @param params array of parameters
* @return null if not found
* @throws DBException if there is any SQLException
*/
public static List<Object> getSQLValueObjectsEx(String trxName, String sql, Object... params) {
List<Object> retValue = new ArrayList<Object>();
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = prepareStatement(sql, trxName);
setParameters(pstmt, params);
rs = pstmt.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
if (rs.next()) {
for (int i=1; i<=rsmd.getColumnCount(); i++) {
Object obj = rs.getObject(i);
if (rs.wasNull())
retValue.add(null);
else
retValue.add(obj);
}
} else {
retValue = null;
}
}
catch (SQLException e)
{
throw new DBException(e, sql);
}
finally
{
close(rs, pstmt);
rs = null; pstmt = null;
}
return retValue;
}
/**
* Get an array of arrays of objects from sql (one per each row, and one per each column on the select clause), column indexing starts with 0
* WARNING: This method must be used just for queries returning few records, using it for many records implies heavy memory consumption
* @param trxName trx
* @param sql sql
* @param params array of parameters
* @return null if not found
* @throws DBException if there is any SQLException
*/
public static List<List<Object>> getSQLArrayObjectsEx(String trxName, String sql, Object... params) {
List<List<Object>> rowsArray = new ArrayList<List<Object>>();
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = prepareStatement(sql, trxName);
setParameters(pstmt, params);
rs = pstmt.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next()) {
List<Object> retValue = new ArrayList<Object>();
for (int i=1; i<=rsmd.getColumnCount(); i++) {
Object obj = rs.getObject(i);
if (rs.wasNull())
retValue.add(null);
else
retValue.add(obj);
}
rowsArray.add(retValue);
}
}
catch (SQLException e)
{
throw new DBException(e, sql);
}
finally
{
close(rs, pstmt);
rs = null; pstmt = null;
}
if (rowsArray.size() == 0)
return null;
return rowsArray;
}
} // DB

View File

@ -1874,7 +1874,7 @@ public final class Env
if (table.getPO_Window_ID() != 0)
{
String whereClause = table.getTableName() + "_ID=" + Record_ID;
isSOTrx = DB.isSOTrx(table.getTableName(), whereClause);
isSOTrx = DB.isSOTrx(table.getTableName(), whereClause, windowNo);
if (!isSOTrx)
AD_Window_ID = table.getPO_Window_ID();
}

View File

@ -178,7 +178,7 @@ public final class Ini implements Serializable
/** Charset */
public static final String P_CHARSET = "Charset";
/** Charser Default Value */
private static final String DEFAULT_CHARSET = Charset.defaultCharset().name();
private static final String DEFAULT_CHARSET = "UTF-8";
/** Load tab fields meta data using background thread **/
public static final String P_LOAD_TAB_META_DATA_BG = "LoadTabMetaDataBackground";

View File

@ -973,6 +973,7 @@ public class MWorkflow extends X_AD_Workflow
if (!docAction.equals(po.get_Value(column.getColumnName())))
{
po.set_ValueOfColumn(column.getColumnName(), docAction);
po.saveEx();
}
ProcessInfo processInfo = new ProcessInfo (((DocAction)po).getDocumentInfo(),column.getAD_Process_ID(),po.get_Table_ID(),po.get_ID());
processInfo.setTransactionName(po.get_TrxName());

View File

@ -508,7 +508,7 @@ public abstract class AbstractElementHandler implements ElementHandler {
String uidColumn = po.getUUIDColumnName();
String[] keys = po.get_KeyColumns();
if (Util.isEmpty((String)po.get_Value(uidColumn)) && (keys == null || keys.length != 1 || po.get_ID() > MTable.MAX_OFFICIAL_ID)) {
throw new IllegalStateException("2Pack doesn't work with record without official Id and UUID");
throw new IllegalStateException("2Pack doesn't work with record without official Id and UUID -> " + po.getUUIDColumnName());
}
}

View File

@ -297,18 +297,6 @@ public class PackInHandler extends DefaultHandler {
setupHandlers();
} else {
Element e = stack.pop();
if (e.contents != null && e.contents.length() > 0)
{
if (e.contents.toString().length() != e.contents.toString().trim().length())
{
String trim = e.attributes.getValue("trim");
if (!(trim != null && trim.equals("false")))
{
String s = e.contents.toString().trim();
e.contents = new StringBuffer(s);
}
}
}
if (stack.isEmpty())
{
try {

View File

@ -31,11 +31,6 @@ public class PoExporter {
private void addTextElement(String qName, String text, AttributesImpl atts) {
try {
//default trim to false for print item label since trailing space is commonly use
//for formatting purpose
if (qName.equalsIgnoreCase("PrintName") || qName.equalsIgnoreCase("UserLevel")) {
atts.addAttribute("", "", "trim", "CDATA", "false");
}
transformerHandler.startElement("", "", qName, atts);
append(text);
transformerHandler.endElement("", "", qName);

View File

@ -4,11 +4,11 @@ root.folder.data=data
root.folder.setup=setup
#linux 64 bits
root.linux.gtk.x86_64=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh
root.linux.gtk.x86_64=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:idempiereEnvTemplate.properties
root.linux.gtk.x86_64.folder.utils=utils.unix
root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh
#linux
root.linux.gtk.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh
root.linux.gtk.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:idempiereEnvTemplate.properties
root.linux.gtk.x86.folder.utils=utils.unix
root.linux.gtk.x86.permissions.755=*.sh,**/*.sh
#mac

View File

@ -0,0 +1,66 @@
#idempiereEnv.properties Template
#idempiere home
IDEMPIERE_HOME=/opt/idempiere-server
#Java home
JAVA_HOME=
#Java runtime options
IDEMPIERE_JAVA_OPTIONS=-Xms64M -Xmx512M
#Type of database, postgresql|oracle|oracleXE
ADEMPIERE_DB_TYPE=PostgreSQL
ADEMPIERE_DB_EXISTS=N
#Path to database specific sql scripts: postgresql|oracle|oracleXE
ADEMPIERE_DB_PATH=postgresql
#Database server host name
ADEMPIERE_DB_SERVER=localhost
#Database port, oracle[1512], postgresql[5432]
ADEMPIERE_DB_PORT=5432
#Database name
ADEMPIERE_DB_NAME=idempiere
#Database system user password
ADEMPIERE_DB_SYSTEM=
#Database user name
ADEMPIERE_DB_USER=adempiere
#Database user password
ADEMPIERE_DB_PASSWORD=adempiere
#Application server host name
ADEMPIERE_APPS_SERVER=localhost
ADEMPIERE_WEB_ALIAS=localhost
#Application server port
ADEMPIERE_WEB_PORT=8080
ADEMPIERE_SSL_PORT=8443
#Keystore setting
ADEMPIERE_KEYSTORE=/opt/idempiere-server/keystore/myKeystore
ADEMPIERE_KEYSTOREWEBALIAS=adempiere
ADEMPIERE_KEYSTORECODEALIAS=adempiere
ADEMPIERE_KEYSTOREPASS=myPassword
#Certificate details
#Common name, default to host name
ADEMPIERE_CERT_CN=localhost
#Organization, default to the user name
ADEMPIERE_CERT_ORG=iDempiere Bazaar
#Organization Unit, default to 'AdempiereUser'
ADEMPIERE_CERT_ORG_UNIT=iDempiereUser
#town
ADEMPIERE_CERT_LOCATION=myTown
#state
ADEMPIERE_CERT_STATE=CA
#2 character country code
ADEMPIERE_CERT_COUNTRY=US
#Mail server setting
ADEMPIERE_MAIL_SERVER=localhost
ADEMPIERE_ADMIN_EMAIL=
ADEMPIERE_MAIL_USER=
ADEMPIERE_MAIL_PASSWORD=
#ftp server setting
ADEMPIERE_FTP_SERVER=localhost
ADEMPIERE_FTP_PREFIX=my
ADEMPIERE_FTP_USER=anonymous
ADEMPIERE_FTP_PASSWORD=user@host.com

View File

@ -23,20 +23,33 @@ fi
PGPASSWORD=$4
export PGPASSWORD
if [ "x$4" = "x^TryLocalConnection^" ]
then
LOCALPG=true # Allow to run this command with user postgres (just useful running configure as root)
else
LOCALPG=false
fi
echo -------------------------------------
echo Recreate user and database
echo -------------------------------------
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
ADEMPIERE_CREATE_ROLE_SQL="CREATE ROLE $2 SUPERUSER LOGIN PASSWORD '$3'"
if [ $LOCALPG = "true" ]
then
# Assuming that adempiere role already exists (it was created out there)
PGPASSWORD=$3
export PGPASSWORD
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U $2 $ADEMPIERE_DB_NAME
else
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
fi
ADEMPIERE_CREATE_ROLE_SQL=
PGPASSWORD=$3
export PGPASSWORD
createdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -O $2 -U $2 $ADEMPIERE_DB_NAME
createdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -T template0 -O $2 -U $2 $ADEMPIERE_DB_NAME
echo -------------------------------------
echo Import Adempiere_pg.dmp

View File

@ -23,20 +23,32 @@ fi
PGPASSWORD=$4
export PGPASSWORD
if [ "x$4" = "x^TryLocalConnection^" ]
then
LOCALPG=true # Allow to run this command with user postgres (just useful running configure as root)
else
LOCALPG=false
fi
echo -------------------------------------
echo Recreate user and database
echo -------------------------------------
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
ADEMPIERE_CREATE_ROLE_SQL="CREATE ROLE $2 SUPERUSER LOGIN PASSWORD '$3'"
if [ $LOCALPG = "true" ]
then
# Assuming that adempiere role already exists (it was created out there)
PGPASSWORD=$3
export PGPASSWORD
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U $2 $ADEMPIERE_DB_NAME
else
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
fi
ADEMPIERE_CREATE_ROLE_SQL=
PGPASSWORD=$3
export PGPASSWORD
createdb --template=template0 -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -O $2 -U $2 $ADEMPIERE_DB_NAME
createdb -T template0 -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -O $2 -U $2 $ADEMPIERE_DB_NAME
echo -------------------------------------
echo Import Adempiere$5.dmp

View File

@ -0,0 +1 @@
/etc/default/idempiere

View File

@ -0,0 +1,12 @@
Package: idempiere
Version: 2.0
Section: web
Priority: extra
Architecture: all
Pre-Depends: openjdk-7-jdk|openjdk-6-jdk, postgresql-9.3|postgresql-9.2|postgresql-9.1, postgresql-contrib, adduser
Suggests: firefox
Installed-Size: 968668
Maintainer: Carlos Ruiz <carg67@gmail.com>
Description: iDempiere ERP
iDempiere Business Suite ERP/CRM/SCM
Homepage: http://www.idempiere.org/

View File

@ -0,0 +1,116 @@
#!/bin/sh
if [ "$1" != "configure" ]
then
exit 0
fi
if [ -z "$2" ]
then
MODE=install
else
MODE=upgrade
fi
if [ -x "/etc/init.d/idempiere" ]; then
update-rc.d idempiere defaults >/dev/null
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d idempiere start || exit 0
else
/etc/init.d/idempiere start || exit 0
fi
fi
echo "Executing Post-install steps..."
if [ "$MODE" = "install" ]
then
if `grep -q ^idempiere: /etc/group`
then
echo ""
else
/usr/sbin/groupadd idempiere
fi
id idempiere > /dev/null 2>&1
status=$?
if test $status -eq 0
then
groups idempiere | grep idempiere > /dev/null
status=$?
if test $status != 0
then
/usr/sbin/usermod -G idempiere idempiere
fi
else
/usr/sbin/useradd -g idempiere -d /opt/idempiere-server -s /bin/bash idempiere
fi
# End MODE=install
fi
if [ "$MODE" = "install" ]
then
# Start Menu icons
mergefile()
{
MENUFILE="$1"
if [ -z "$MENUFILE" ]
then
return
fi
TFILE="$(mktemp)" || TFILE="/tmp/idempiereapplications.tmp"
(sed -n '1,/<\/Menu>/p' "$MENUFILE" ; cat /opt/idempiere-server/utils/unix/idempiere-merge-debian.menu ; sed -n '1,/<\/Menu>/!p' "$MENUFILE" ) > "$TFILE"
cp -f "$TFILE" "$MENUFILE"
rm -f "$TFILE"
}
if [ -f /etc/xdg/menus/gnome-applications.menu ]
then
mergefile /etc/xdg/menus/gnome-applications.menu
fi
if [ -f /etc/xdg/menus/kde-applications.menu ]
then
mergefile /etc/xdg/menus/kde-applications.menu
fi
if [ -f /etc/xdg/menus/applications.menu ]
then
mergefile /etc/xdg/menus/applications.menu
fi
# End MODE=install
fi
/bin/chown -R idempiere:idempiere /opt/idempiere-server
/bin/chown idempiere:idempiere /etc/default/idempiere
/bin/chown idempiere:idempiere /etc/init.d/idempiere
/bin/chown idempiere:idempiere /etc/xdg/menus/idempiere.menu
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-backup.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-gotoonlineforum.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-homepage.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-readdocumentation.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-restore.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-startserver.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-webclient.desktop
/bin/chown idempiere:idempiere /usr/share/desktop-directories/idempiere.directory
/bin/chown idempiere:idempiere /usr/share/desktop-directories/idempiere-gethelp.directory
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-backup.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-gethelp.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-gotoonlineforum.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-readdocumentation.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-restore.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-start.png
CONFIGURATION=/etc/default/idempiere
[ -f "$CONFIGURATION" ] && . "$CONFIGURATION"
if [ "$CONFIGURE_RUN" != "true" ]
then
echo "You must run '/etc/init.d/idempiere configure' as the root user to configure the application."
echo
fi
exit 0

View File

@ -0,0 +1,70 @@
#!/bin/sh
case "$1" in
remove|purge)
;;
*)
exit 0
;;
esac
if [ "$1" = "purge" ] ; then
update-rc.d idempiere remove >/dev/null || exit 0
fi
case "$1" in
purge)
rm -fr /opt/idempiere-server
# rm -fr /etc/default/idempiere
# rm -fr /etc/init.d/idempiere
# rm -fr /etc/xdg/menus/idempiere.menu
rm -fr /usr/share/desktop-directories/idempiere-gethelp.directory
rm -fr /usr/share/desktop-directories/idempiere.directory
rm -fr /usr/share/pixmaps/idempiere-restore.png
rm -fr /usr/share/pixmaps/idempiere.png
rm -fr /usr/share/pixmaps/idempiere-gethelp.png
rm -fr /usr/share/pixmaps/idempiere-gotoonlineforum.png
rm -fr /usr/share/pixmaps/idempiere-backup.png
rm -fr /usr/share/pixmaps/idempiere-start.png
rm -fr /usr/share/pixmaps/idempiere-readdocumentation.png
rm -fr /usr/share/applications/idempiere-gotoonlineforum.desktop
rm -fr /usr/share/applications/idempiere-homepage.desktop
rm -fr /usr/share/applications/idempiere-webclient.desktop
rm -fr /usr/share/applications/idempiere-readdocumentation.desktop
rm -fr /usr/share/applications/idempiere-restore.desktop
rm -fr /usr/share/applications/idempiere-startserver.desktop
rm -fr /usr/share/applications/idempiere-backup.desktop
;;
*)
;;
esac
mergefile()
{
MENUFILE="$1"
if [ -z "$MENUFILE" ]
then
return
fi
TFILE="$(mktemp)" || TFILE="/tmp/idempiereapplications.tmp"
sed -n '/<\!\-- iDempiere \-->/,/<\!\-- End of iDempiere \-->/!p' "$MENUFILE" > "$TFILE"
cp -f "$TFILE" "$MENUFILE"
rm -f "$TFILE"
}
if [ -f /etc/xdg/menus/gnome-applications.menu ]
then
mergefile /etc/xdg/menus/gnome-applications.menu
fi
if [ -f /etc/xdg/menus/kde-applications.menu ]
then
mergefile /etc/xdg/menus/kde-applications.menu
fi
if [ -f /etc/xdg/menus/applications.menu ]
then
mergefile /etc/xdg/menus/applications.menu
fi
exit 0

View File

@ -0,0 +1,48 @@
#!/bin/sh
if [ "$1" != "install" -o -n "$2" ]
then
exit 0
fi
# User must be root
if [ $(id -u) != "0" ]
then
echo "You must be the root to install the software" >&2
exit 1
fi
# IDEMPIERE_HOME must be unset
if `env | grep -q IDEMPIERE_HOME`
then
unset IDEMPIERE_HOME
fi
# Check for sufficient diskspace
if [ -d /opt/idempiere-server ]
then
diskspace=`df -k /opt/idempiere-server | grep % | tr -s " " | cut -d" " -f4 | tail -1`
diskspace=`expr $diskspace / 1024`
if [ $diskspace -lt 1024 ]
then
echo "You have insufficient diskspace in the destination directory (/opt/idempiere-server)
to install idempiere The installation requires at
least 1 GB free on this disk."
exit 1
fi
else
diskspace=`df -k /usr/lib | grep % | tr -s " " | cut -d" " -f4 | tail -1`
diskspace=`expr $diskspace / 1024`
if [ $diskspace -lt 1024 ]
then
echo "You have insufficient diskspace in the destination directory (/usr/lib) to
install idempiere. The installation requires at
least 1 GB free on this disk."
exit 1
fi
fi
# Don't fail, even on sysctl errors
exit 0

View File

@ -0,0 +1,17 @@
#!/bin/sh
if [ "$1" != "remove" ]
then
exit 0
fi
if [ -x "/etc/init.d/idempiere" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d idempiere stop || exit 0
else
/etc/init.d/idempiere stop || exit 0
fi
fi
exit 0

View File

@ -0,0 +1,3 @@
#
# Please run "/etc/init.d/idempiere configure" to configure iDempiere.
#

View File

@ -0,0 +1,736 @@
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: idempiere
# Required-Start: postgresql
# Required-Stop: postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: iDempiere server
# Description: Provides iDempiere ERP-CRM Server startup and shutdown script. Requires PostgreSQL server.
# FileTarget: /etc/init.d/idempiere
# FileOwner: root.root
# FilePerms: 0755
#
# chkconfig: 2345 97 06
### END INIT INFO
# processname: idempiere
# Red Hat or SuSE config: /etc/sysconfig/idempiere
# Debian or Ubuntu config: /etc/default/idempiere
# Source function library
if [ -f /lib/lsb/init-functions ]
then
. /lib/lsb/init-functions
elif [ -f /etc/init.d/functions ]
then
. /etc/init.d/functions
fi
# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/sbin:/etc
export PATH ;;
esac
# initialization
# adjust these variables to your environment
IDEMPIERE_USER=idempiere
IDEMPIERE_HOME=/opt/idempiere-server
JAVA_HOME=`ls -r /usr/lib/jvm/java-[67]-openjdk*/bin/javac | head -1`
JAVA_HOME=`dirname $JAVA_HOME`
JAVA_HOME=`dirname $JAVA_HOME`
SU=su
export IDEMPIERE_HOME
if [ $(id -u) != "0" ]
then
echo "You must be root to run the configure script. Login as root and then run the configure script."
exit 1
fi
RETVAL=0
IDEMPIERESTATUS=
MAXSECONDS=120 # max wait 2 minutes
SLEEPSECONDS=2
MAXITERATIONS=`expr $MAXSECONDS / $SLEEPSECONDS`
CONFIG_NAME=idempiere
CONFIGURATION="/etc/sysconfig/$CONFIG_NAME"
if [ -f /etc/redhat-release ]
then
. /etc/init.d/functions
init_status()
{
return 0
}
exit_status()
{
exit $?
}
success_status()
{
success
echo
}
failure_status()
{
failure $?
echo
}
elif [ -f /etc/SuSE-release ]
then
. /etc/rc.status
init_status()
{
rc_reset
}
success_status()
{
echo "OK"
return 0
}
failure_status()
{
echo "Failed"
return 1
}
exit_status()
{
exit $?
}
else
if [ -d /etc/default ]
then
CONFIGURATION="/etc/default/$CONFIG_NAME"
fi
init_status()
{
return 0
}
success_status()
{
echo "OK"
return 0
}
failure_status()
{
echo "Failed"
return 0
}
exit_status()
{
exit $?
}
fi
# Source configuration
[ -f "$CONFIGURATION" ] && . "$CONFIGURATION"
init_status
#
# if_fail()
#
# Evaluates return codes. If 0, prints "OK", if 1, prints "Failed"
# and exits. If 2, status is "already done" and nothing is printed.
# The rest of the functions in here all honor this convention.
#
if_fail()
{
RC="$1"
REASON="$2"
if [ "$RC" = "0" ]
then
return
elif [ "$RC" = "2" ]
then
return
fi
failure_status "${REASON}"
exit 1
}
#
# write_sysconfig()
#
# Writes the system configuration
#
write_sysconfig()
{
cat >"$CONFIGURATION" <<EOF
#This is a configuration file for automatic starting of the iDempiere
#Server at system startup. It is generated by running
#'/etc/init.d/idempiere configure'.Please use that method to modify this
#file
# RUN_AT_STARTUP:'true' means to load the Server at system boot.
RUN_AT_STARTUP=${RUN_AT_STARTUP:-false}
# Configuration : Check whether configure has been done or not
CONFIGURE_RUN=${CONFIGURE_RUN}
EOF
if [ $? != 0 ]
then
return 1
fi
return 0
}
# configure_perform()
# Create idempiereEnv.properties
# RUN_silentsetup.sh
# Import database
configure_perform()
{
cp ${IDEMPIERE_HOME}/idempiereEnvTemplate.properties ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^IDEMPIERE_HOME=.*:IDEMPIERE_HOME=${IDEMPIERE_HOME}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^JAVA_HOME=.*:JAVA_HOME=${JAVA_HOME}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_DB_PASSWORD=.*:ADEMPIERE_DB_PASSWORD=${ADEMPIERE_DB_PASSWORD}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_DB_SYSTEM=.*:ADEMPIERE_DB_SYSTEM=${ADEMPIERE_DB_SYSTEM}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_WEB_PORT=.*:ADEMPIERE_WEB_PORT=${ADEMPIERE_WEB_PORT}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_SSL_PORT=.*:ADEMPIERE_SSL_PORT=${ADEMPIERE_SSL_PORT}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_APPS_SERVER=.*:ADEMPIERE_APPS_SERVER=0.0.0.0:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_KEYSTORE=.*:ADEMPIERE_KEYSTORE=${IDEMPIERE_HOME}/keystore/myKeystore:" ${IDEMPIERE_HOME}/idempiereEnv.properties
chown idempiere:idempiere ${IDEMPIERE_HOME}/idempiereEnv.properties
chmod 600 ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s/:8080/:${ADEMPIERE_WEB_PORT}/g" /usr/share/applications/idempiere-homepage.desktop
sed -i "s/:8443/:${ADEMPIERE_SSL_PORT}/g" /usr/share/applications/idempiere-webclient.desktop
if [ -f ${IDEMPIERE_HOME}/console-setup.sh ]
then
echo -n "Deploying iDempiere ERP server..."
$SU ${IDEMPIERE_USER} -c "cd ${IDEMPIERE_HOME}; ./console-setup.sh" <<!
!
echo "Done"
fi
grep ${ADEMPIERE_WEB_PORT} ${IDEMPIERE_HOME}/plugins/org.adempiere.tomcat.config_2.0.0/META-INF/tomcat/server.xml > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Error deploying iDempiere, please verify and try again"
exit 1
fi
if [ "x${ADEMPIERE_DB_SYSTEM}" = "x^TryLocalConnection^" ]
then
# recreate idempiere user from here as the RUN_ImportIdempiere requires it
$SU postgres -c "dropdb -U postgres idempiere" # > /dev/null 2>&1
$SU postgres -c "dropuser -U postgres idempiere" # > /dev/null 2>&1
$SU postgres -c "psql -U postgres -c \"CREATE ROLE adempiere SUPERUSER LOGIN PASSWORD '${ADEMPIERE_DB_PASSWORD}'\"" # > /dev/null 2>&1
fi
if [ -f ${IDEMPIERE_HOME}/utils/RUN_ImportIdempiere.sh ]
then
echo -n "Importing seed database..."
$SU ${IDEMPIERE_USER} -c "cd ${IDEMPIERE_HOME}/utils; ( echo "" | ./RUN_ImportIdempiere.sh )" # > /dev/null 2>&1
echo "Done"
fi
$SU ${IDEMPIERE_USER} -c "export PGPASSWORD=${ADEMPIERE_DB_PASSWORD}; psql -d idempiere -U adempiere -h localhost -p 5432 -c ''" > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Cannot connect to idempiere database, please verify and try again"
exit 1
fi
$SU ${IDEMPIERE_USER} -c "export PGPASSWORD=${ADEMPIERE_DB_PASSWORD}; psql -d idempiere -U adempiere -h localhost -p 5432 -c 'select count(*) from ad_system' 2>&1 | grep '1$'" > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Database not imported correctly, please verify and try again"
exit 1
fi
chmod 700 ${IDEMPIERE_HOME}/utils/myEnvironment.*
echo "Installation Completed Successfully."
return 0
}
checkportused()
{
port=`netstat -n --tcp --listen | grep :$1 | awk '{print $4}' | cut -d':' -f2`
if [ "$port" = "$1" ]
then
return 0 # Used
else
return 1 # Not Used
fi
}
#
#configure_ask()
#
# Ask configuration questions,setting the variables.
#
configure_ask()
{
cat <<EOF
iDempiere ERP Server Configuration
-------------------------------------------------
This will configure on-boot properties of iDempiere ERP Server.
The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press <Enter> to accept the defaults.
Ctrl-C will abort.
EOF
# TODO: ask for certificate data (or integrate with openssl certificate)
# TODO: ask for mail server settings
# TODO: ask for postgres port (and perhaps machine if it's remote)
# Check not configurable tomcat ports (i.e. 8005, 8009)
for TOMCATPORT in 8005 8009
do
if checkportused "$TOMCATPORT"
then
echo Port $TOMCATPORT is required by iDempiere ERP server and it appears to be in use by another application.\
Please fix the problem and try again.
exit 1
fi
done
#get the http port value
while :
do
while [ 1 ]
do
echo -n Specify the HTTP port that will be used for iDempiere server [8080]:
read LINE
if [ -z $LINE ]
then
LINE=8080
fi
if checkportused "$LINE"
then
echo Port $port appears to be in use by another application.\
Please specify a different port.
else
break;
fi
done
case "$LINE" in
"")
break
;;
*[^0-9]*)
echo "Invalid http port: $LINE"
;;
*)
ADEMPIERE_WEB_PORT=$LINE
break
;;
esac
done
#get the https port value
while :
do
while [ 1 ]
do
echo -n Specify the HTTPS port that will be used for iDempiere server [8443]:
read LINE
if [ -z $LINE ]
then
LINE=8443
fi
if checkportused "$LINE"
then
echo Port $port appears to be in use by another application.\
Please specify a different port.
else
break;
fi
done
case "$LINE" in
"")
break
;;
*[^0-9]*)
echo "Invalid https port: $LINE"
;;
*)
ADEMPIERE_SSL_PORT=$LINE
break
;;
esac
done
#get the idempiere database password
while :
do
echo -n "Specify a password to be used for adempiere database account:"
while [ 1 ]
do
stty -echo > /dev/null 2>&1
temp=`echo $IFS`
export IFS="\n"
while [ 1 ]
do
read LINE
while [ -z "$LINE" ]
do
echo
echo -n "Password can't be null. Enter password:"
read LINE
done
result=`expr index "$LINE" [\'\"]`
if [ $result != 0 ];
then
echo
echo -n "The password you entered contains invalid characters. Enter password:"
else
break
fi
done
echo
echo -n "Confirm the password:"
read LINE1
echo
if [ "$LINE" != "$LINE1" ];
then
echo
echo -n "Passwords do not match. Enter the password:"
else
break
fi
done
stty echo > /dev/null 2>&1
ADEMPIERE_DB_PASSWORD=$LINE
export IFS=$temp
break;
done
#get the postgres database password
while :
do
echo -n "Specify the password of the user postgres on postgres database
(if empty then local connection will be tried):"
while [ 1 ]
do
stty -echo > /dev/null 2>&1
temp=`echo $IFS`
export IFS="\n"
while [ 1 ]
do
read LINE
if [ -z "$LINE" ]
then
break
fi
result=`expr index "$LINE" [\'\"]`
if [ $result != 0 ];
then
echo
echo -n "The password you entered contains invalid characters. Enter password:"
else
break
fi
done
echo
if [ -z "$LINE" ]
then
# Empty postgres password verify connection with local postgres user
$SU postgres -c "psql -U postgres -c ''"
if [ $? -eq 0 ]
then
break
fi
echo -n "Could not connect locally with user postgres.
NOTE: You can verify pg_hba.conf to check if this line is enabled
local all postgres ident
Enter postgres password:"
else
PGPASSWORD=$LINE
export PGPASSWORD
psql -U postgres -d template1 -h localhost -p 5432 -c ''
if [ $? -eq 0 ]
then
break
fi
echo -n "Could not connect with user postgres to database template with such password.
NOTE: You can check the file pg_hba.conf to validate that connection is allowed,
or check that postgresql server allows tcp/ip connections on port 5432
or check that user postgres database password is correctly set.
Enter postgres password:"
fi
done
stty echo > /dev/null 2>&1
if [ -z "$LINE" ]
then
LINE="^TryLocalConnection^"
fi
ADEMPIERE_DB_SYSTEM=$LINE
export IFS=$temp
break;
done
while :
do
if [ "${RUN_AT_STARTUP}" = "true" ]
then
CUR=y
else
CUR=n
fi
echo
echo -n "Do you want iDempiere ERP Server to be started on boot (y/n) [y]:"
read LINE
if [ -z $LINE ]
then
RUN_AT_STARTUP=true
fi
echo
case "$LINE" in
"")
break
;;
y|Y)
RUN_AT_STARTUP=true
break
;;
n|N)
RUN_AT_STARTUP=false
break
;;
*)
echo "Invalid response: $LINE " >&2
break
esac
done
}
getidempierestatus() {
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep ${IDEMPIERE_HOME})
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME}
IDEMPIERESTATUS=$?
}
configure()
{
if [ "${CONFIGURE_RUN}" = "true" ]
then
echo "iDempiere is already configured"
exit 1
fi
configure_ask
configure_perform
CONFIGURE_RUN=true
write_sysconfig
echo To access the iDempiere Server Home Page, start the server with '/etc/init.d/idempiere start'
echo and then go to \"http://127.0.0.1:${ADEMPIERE_WEB_PORT}\"
}
start () {
if [ "${CONFIGURE_RUN}" != "true" ]
then
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
getidempierestatus
if [ $IDEMPIERESTATUS -eq 0 ] ; then
echo "iDempiere is already running"
return 1
fi
echo -n "Starting iDempiere ERP: "
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
$SU ${IDEMPIERE_USER} -c "mkdir -p $IDEMPIERE_HOME/log"
$SU ${IDEMPIERE_USER} -c "cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
# wait for server to be confirmed as started in logfile
STATUSTEST=0
ITERATIONS=0
while [ $STATUSTEST -eq 0 ] ; do
sleep $SLEEPSECONDS
tail -n 9 $LOGFILE | grep -q '.*WebUIServlet.*started successfully.*' && STATUSTEST=1
echo -n "."
ITERATIONS=`expr $ITERATIONS + 1`
if [ $ITERATIONS -gt $MAXITERATIONS ]
then
break
fi
done
if [ $STATUSTEST -eq 0 ]
then
log_warning_msg "Service hasn't started within the timeout allowed, please review file $LOGFILE to see the status of the service"
else
log_success_msg "Service started"
fi
echo
else
log_failure_msg "Service not started"
echo
fi
RETVAL=$?
return $RETVAL
}
stop () {
if [ "${CONFIGURE_RUN}" != "true" ]
then
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then
echo "iDempiere is already stopped"
return 1
fi
echo -n "Stopping iDempiere ERP: "
cd $IDEMPIERE_HOME/utils
log_warning_msg "Trying direct kill with signal -15"
# try direct kill with signal 15, then signal 9
kill -15 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
sleep 5
getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then
log_success_msg "Service stopped with kill -15"
else
echo "Trying direct kill with signal -9"
kill -9 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
sleep 5
getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then
log_success_msg "Service stopped with kill -9"
else
log_warning_msg "Service hasn't stopped"
fi
fi
return $RETVAL
}
restart () {
stop
sleep $SLEEPSECONDS
start
}
condrestart () {
getidempierestatus
if [ $IDEMPIERESTATUS -eq 0 ] ; then
restart
fi
}
dostatus () {
getidempierestatus
if [ $IDEMPIERESTATUS -eq 0 ] ; then
echo
echo "iDempiere is running:"
ps ax | grep -v grep | grep ${IDEMPIERE_HOME} | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
echo
else
echo "iDempiere is stopped"
fi
}
case "$1" in
start)
if test -f "$CONFIGURATION"
then
if test "${RUN_AT_STARTUP}" != "true"
then
exit 0
fi
else
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
start
;;
configure)
configure
;;
stop)
stop
;;
restart|reload|force-reload)
restart
;;
condrestart)
condrestart
;;
status)
dostatus
;;
enable)
if test -f "$CONFIGURATION"
then
RUN_AT_STARTUP=true
write_sysconfig
else
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
;;
disable)
if test -f "$CONFIGURATION"
then
RUN_AT_STARTUP=false
write_sysconfig
else
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|force-reload|configure|status|enable|disable}"
exit 1
esac
exit 0

View File

@ -0,0 +1,23 @@
<!-- iDempiere ERP -->
<Menu>
<Name>iDempiere ERP</Name>
<Directory>idempiere.directory</Directory>
<NotDeleted/>
<Include>
<Filename>idempiere-startserver.desktop</Filename>
<Filename>idempiere-homepage.desktop</Filename>
<Filename>idempiere-webclient.desktop</Filename>
<Filename>idempiere-backup.desktop</Filename>
<Filename>idempiere-restore.desktop</Filename>
</Include>
<Menu>
<Name>Get Help</Name>
<Directory>idempiere-gethelp.directory</Directory>
<NotDeleted/>
<Include>
<Filename>idempiere-gotoonlineforum.desktop</Filename>
<Filename>idempiere-readdocumentation.desktop</Filename>
</Include>
</Menu>
</Menu>
<!-- End of iDempiere -->

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Exec=gksudo "su -c idempiere '/opt/idempiere-server/utils/RUN_DBExport.sh'"
Terminal=true
MultipleArgs=true
Type=Application
Categories=Applications;
Icon=idempiere-backup.png
Encoding=UTF-8
Name=Backup Database
Name[es]=Copia de Seguridad de Base de Datos

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Terminal=false
MultipleArgs=true
Type=Link
URL=https://groups.google.com/forum/?fromgroups#!forum/idempiere
Categories=Applications;
Icon=idempiere-gotoonlineforum.png
Encoding=UTF-8
Name=Go To Online Forum
Name[es]=Ir a Foro en Línea

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Terminal=false
MultipleArgs=true
Type=Link
URL=http://localhost:8080
Categories=Applications;
Icon=idempiere.png
Encoding=UTF-8
Name=iDempiere Homepage
Name[es]=Página Principal iDempiere

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Terminal=false
MultipleArgs=true
Type=Link
URL=http://wiki.idempiere.org
Categories=Applications;
Icon=idempiere-readdocumentation.png
Encoding=UTF-8
Name=Read Documentation
Name[es]=Leer Documentación

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Exec=gksudo "su -c idempiere '/opt/idempiere-server/utils/RUN_DBRestore.sh'"
Terminal=true
MultipleArgs=true
Type=Application
Categories=Applications;
Icon=idempiere-restore.png
Encoding=UTF-8
Name=Restore Database
Name[es]=Restaurar Base de Datos

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Exec=gksudo "su -c idempiere '/opt/idempiere-server/idempiere-server.sh'"
Terminal=true
MultipleArgs=true
Type=Application
Categories=Applications;
Icon=idempiere-start.png
Encoding=UTF-8
Name=Start Server
Name[es]=Iniciar Servidor

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Terminal=false
MultipleArgs=true
Type=Link
URL=https://localhost:8443/webui
Categories=Applications;
Icon=idempiere-gotoonlineforum.png
Encoding=UTF-8
Name=iDempiere Web Client
Name[es]=Cliente Web iDempiere

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Icon=idempiere-gethelp.png
Type=Directory
Encoding=UTF-8
Name=Get Help
Name[es]=Obtener Ayuda

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Icon=idempiere.png
Type=Directory
Encoding=UTF-8
Name=iDempiere ERP
Name[es]=iDempiere ERP

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,23 @@
VERSION=dev
TIMESTAMP=`date +%Y%m%d`
TMP=/tmp
cd `dirname $0`/../../..
IDEMPIERE_HOME=`pwd`
RWD=$IDEMPIERE_HOME/idempiere-server/utils/unix
PACKAGE=`ls -d $IDEMPIERE_HOME`
PACKAGE=`basename $PACKAGE`
PACKFILE=$IDEMPIERE_HOME/../${PACKAGE}_${VERSION}_${TIMESTAMP}.deb
find $RWD/../.. -name "*.sh" -exec chmod +x {} \;
chmod +x $RWD/DebianInstaller/etc/init.d/idempiere
rm -f $TMP/debian-binary $TMP/control.tar.gz $TMP/data.tar.gz $TMP/control.tar $TMP/data.tar $PACKFILE
echo 2.0 > $TMP/debian-binary
tar cvf $TMP/control.tar -C $RWD/DebianInstaller/DEBIAN .
gzip -v -9 $TMP/control.tar
tar cvf $TMP/data.tar -C $RWD/DebianInstaller/ ./usr
tar rvf $TMP/data.tar --exclude='idempiere.gtk.linux.x86_64/idempiere-server/utils/unix/createDEBpackage.sh' --exclude='idempiere.gtk.linux.x86_64/idempiere-server/utils/unix/DebianInstaller' --transform 's:^idempiere.gtk.linux.x86_64/idempiere-server:./opt/idempiere-server:' -C $RWD/../../../.. $PACKAGE > /dev/null
tar rvf $TMP/data.tar -C $RWD/DebianInstaller/ ./etc
gzip -v -9 $TMP/data.tar
cd $TMP
ar q $PACKFILE debian-binary control.tar.gz data.tar.gz
rm debian-binary control.tar.gz data.tar.gz
echo "Created $PACKFILE"

View File

@ -0,0 +1,7 @@
<!-- iDempiere -->
<Menu>
<Name>iDempiere</Name>
<MergeFile>idempiere.menu</MergeFile>
</Menu>
<!-- End of iDempiere -->

View File

@ -182,8 +182,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
}
private void processQueryValue() {
//try first 2 only
for(int i = 0; i < identifiers.size() && i < 2; i++) {
for (int i = 0; i < identifiers.size(); i++) {
WEditor editor = identifiers.get(i);
editor.setValue(queryValue);
testCount();

View File

@ -122,7 +122,8 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener<Event>
if (queryValue != null && queryValue.length() > 0)
{
MTable table = MTable.get(Env.getCtx(), p_tableName);
if (table.getIdentifierColumns().length > 1)
if ( table.getIdentifierColumns().length > 1
&& !p_tableName.startsWith("AD_")) // 32 AD tables with identifiers containing _
{
String separator = I_C_ElementValue.Table_Name.equalsIgnoreCase(p_tableName) ? "-" : "_";
if (txt2.isVisible())

View File

@ -136,10 +136,15 @@ public class ConfigPostgreSQL implements IDatabaseConfig
if (!pass) {
if (isDBExists) {
log.warning(error);
} else {
if ("^TryLocalConnection^".equals(systemPassword)) {
// Debian installer uses postgres socket domain connection
log.warning(error);
} else {
return error;
}
}
}
if (log.isLoggable(Level.INFO)) log.info("OK: System Connection = " + urlSystem);
data.setProperty(ConfigurationData.ADEMPIERE_DB_SYSTEM, systemPassword);