IDEMPIERE-1715 Implement Document Action for Production / integrate and peer review patch from Heng Sin

This commit is contained in:
Carlos Ruiz 2014-04-16 17:58:33 -05:00
parent 50bfd9089c
commit 33753cb358
7 changed files with 1551 additions and 80 deletions

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) 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_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) NOT NULL DEFAULT 'DR'
;
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

@ -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 {
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();
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());
}
processed = processed + lines.length;
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();
linesCount += lines.length;
}
plan.setProcessed(true);
plan.saveEx();
return linesCount;
} else {
return production.getLines().length;
}
}
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);
} else {
lines[i].setProcessed( true );
lines[i].saveEx(production.get_TrxName());
}
}
return errors.toString();
}
}

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

@ -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

@ -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
*/