From 0b986141132e15a7b8276c706ea5a61406945fb8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 27 Aug 2012 18:21:27 -0500 Subject: [PATCH] IDEMPIERE-246 Integrate Manufacturing Light / peer review with tests following Adaxa Manual - lots of fixes --- .../oracle/894_IDEMPIERE-246.sql | 405 ++++++++++++++++++ .../postgresql/894_IDEMPIERE-246.sql | 405 ++++++++++++++++++ .../org/compiere/process/BOMFlagValidate.java | 137 +++--- .../src/org/compiere/process/BOMValidate.java | 6 +- .../src/org/compiere/process/BOMVerify.java | 34 +- .../src/org/compiere/process/IndentedBOM.java | 10 +- .../compiere/process/ProductionProcess.java | 9 +- .../process/ReplenishReportProduction.java | 19 +- .../src/org/compiere/process/RollUpCosts.java | 66 +-- .../process/UniversalSubstitution.java | 29 +- .../src/org/compiere/model/MProduction.java | 25 +- .../org/compiere/model/MProductionLine.java | 15 +- .../org/compiere/model/MProductionLineMA.java | 4 +- .../src/org/compiere/model/MStorage.java | 2 +- .../adempiere/webui/apps/form/WTreeBOM.java | 34 +- 15 files changed, 985 insertions(+), 215 deletions(-) create mode 100644 migration/360lts-release/oracle/894_IDEMPIERE-246.sql create mode 100644 migration/360lts-release/postgresql/894_IDEMPIERE-246.sql diff --git a/migration/360lts-release/oracle/894_IDEMPIERE-246.sql b/migration/360lts-release/oracle/894_IDEMPIERE-246.sql new file mode 100644 index 0000000000..c21979379f --- /dev/null +++ b/migration/360lts-release/oracle/894_IDEMPIERE-246.sql @@ -0,0 +1,405 @@ +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=167 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=357 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=229 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=412 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=256 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=197 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=477 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=181 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=179 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=503 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=196 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=228 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=479 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=482 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=481 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=411 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53253 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=17, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=426 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=18, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=537 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=19, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=311 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=20, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=292 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=21, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=504 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=22, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=515 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=218 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=153 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=263 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=166 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=203 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53242 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=236 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=183 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=160 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=278 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53296 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=345 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53014 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53108 +; + +-- Aug 27, 2012 8:17:46 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Menu SET Name='Manufacturing',Updated=TO_DATE('2012-08-27 08:17:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53296 +; + +-- Aug 27, 2012 8:17:46 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53296 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=167 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=357 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=229 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=412 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=256 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=197 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=477 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=181 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=179 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=503 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=196 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=479 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=482 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=481 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=411 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53253 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=426 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=17, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=537 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=18, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=311 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=19, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=292 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=20, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=504 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=21, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=515 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53350 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53351 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53298 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53299 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53300 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53301 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53352 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53302 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53353 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53354 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=228 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53297 +; + +-- Aug 27, 2012 3:15:50 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=61997 +; + +-- Aug 27, 2012 3:15:58 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=61997 +; + +-- Aug 27, 2012 5:34:16 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET SeqNo=10,Updated=TO_DATE('2012-08-27 17:34:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53520 +; + +-- Aug 27, 2012 5:34:23 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET IsMandatory='Y', FieldLength=10, SeqNo=20,Updated=TO_DATE('2012-08-27 17:34:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53521 +; + +-- Aug 27, 2012 5:34:27 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET SeqNo=30,Updated=TO_DATE('2012-08-27 17:34:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53522 +; + +-- Aug 27, 2012 5:34:32 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET FieldLength=10,Updated=TO_DATE('2012-08-27 17:34:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53520 +; + +-- Aug 27, 2012 5:34:36 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET FieldLength=10,Updated=TO_DATE('2012-08-27 17:34:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53522 +; + +UPDATE AD_System + SET LastMigrationScriptApplied='894_IDEMPIERE-246.sql' +WHERE LastMigrationScriptApplied<'894_IDEMPIERE-246.sql' + OR LastMigrationScriptApplied IS NULL +; diff --git a/migration/360lts-release/postgresql/894_IDEMPIERE-246.sql b/migration/360lts-release/postgresql/894_IDEMPIERE-246.sql new file mode 100644 index 0000000000..a0fd005f7e --- /dev/null +++ b/migration/360lts-release/postgresql/894_IDEMPIERE-246.sql @@ -0,0 +1,405 @@ +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=167 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=357 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=229 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=412 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=256 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=197 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=477 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=181 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=179 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=503 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=196 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=228 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=479 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=482 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=481 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=411 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53253 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=17, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=426 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=18, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=537 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=19, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=311 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=20, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=292 +; + +-- Aug 27, 2012 8:17:35 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=21, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=504 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=22, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=515 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=218 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=153 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=263 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=166 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=203 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53242 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=236 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=183 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=160 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=278 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53296 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=345 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53014 +; + +-- Aug 27, 2012 8:17:36 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53108 +; + +-- Aug 27, 2012 8:17:46 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Menu SET Name='Manufacturing',Updated=TO_TIMESTAMP('2012-08-27 08:17:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53296 +; + +-- Aug 27, 2012 8:17:46 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=53296 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=167 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=357 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=229 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=412 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=256 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=197 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=477 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=181 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=179 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=503 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=196 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=479 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=482 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=481 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=411 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53253 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=426 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=17, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=537 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=18, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=311 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=19, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=292 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=20, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=504 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=21, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=515 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53350 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53351 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53298 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53299 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53300 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53301 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53352 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53302 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53353 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53354 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=228 +; + +-- Aug 27, 2012 8:19:57 AM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53297 +; + +-- Aug 27, 2012 3:15:50 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=61997 +; + +-- Aug 27, 2012 3:15:58 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=61997 +; + +-- Aug 27, 2012 5:34:16 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET SeqNo=10,Updated=TO_TIMESTAMP('2012-08-27 17:34:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53520 +; + +-- Aug 27, 2012 5:34:23 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET IsMandatory='Y', FieldLength=10, SeqNo=20,Updated=TO_TIMESTAMP('2012-08-27 17:34:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53521 +; + +-- Aug 27, 2012 5:34:27 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET SeqNo=30,Updated=TO_TIMESTAMP('2012-08-27 17:34:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53522 +; + +-- Aug 27, 2012 5:34:32 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET FieldLength=10,Updated=TO_TIMESTAMP('2012-08-27 17:34:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53520 +; + +-- Aug 27, 2012 5:34:36 PM COT +-- IDEMPIERE-246 Integrate Manufacturing Light +UPDATE AD_Process_Para SET FieldLength=10,Updated=TO_TIMESTAMP('2012-08-27 17:34:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53522 +; + +UPDATE AD_System + SET LastMigrationScriptApplied='894_IDEMPIERE-246.sql' +WHERE LastMigrationScriptApplied<'894_IDEMPIERE-246.sql' + OR LastMigrationScriptApplied IS NULL +; diff --git a/org.adempiere.base.process/src/org/compiere/process/BOMFlagValidate.java b/org.adempiere.base.process/src/org/compiere/process/BOMFlagValidate.java index 1f76487243..eba3847126 100644 --- a/org.adempiere.base.process/src/org/compiere/process/BOMFlagValidate.java +++ b/org.adempiere.base.process/src/org/compiere/process/BOMFlagValidate.java @@ -2,8 +2,10 @@ package org.compiere.process; import java.sql.PreparedStatement; import java.sql.ResultSet; +import java.sql.SQLException; import java.util.logging.Level; +import org.compiere.model.MProduct; import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; import org.compiere.util.DB; @@ -35,50 +37,61 @@ public class BOMFlagValidate extends SvrProcess { flagNonBOMs(); flagBOMs(); - return "BOM Flags set correctly"; + return "@OK@"; } - private void flagNonBOMs() throws Exception + private void flagNonBOMs() throws SQLException { //Select Products where there's a BOM, and there are no lines - String sql = "SELECT NAME FROM M_PRODUCT WHERE ISBOM = 'Y' AND " + - "M_PRODUCT_ID NOT IN (SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM ) AND "; + String sql = "SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'Y' AND " + + "M_Product_ID NOT IN (SELECT M_Product_ID FROM M_Product_BOM ) AND "; if (p_M_Product_Category_ID == 0) sql += "AD_Client_ID= ?"; else sql += "M_Product_Category_ID= ?"; PreparedStatement pstmt = null; - pstmt = DB.prepareStatement (sql, null); - if (p_M_Product_Category_ID == 0) - pstmt.setInt (1, Env.getAD_Client_ID(getCtx())); - else - pstmt.setInt(1, p_M_Product_Category_ID); - ResultSet rs = pstmt.executeQuery (); - - while (rs.next()) - { - addLog(0, null, null, rs.getString(1) + "Has Been Flagged as NonBOM as it has no lines"); + ResultSet rs = null; + try { + pstmt = DB.prepareStatement (sql, get_TrxName()); + if (p_M_Product_Category_ID == 0) + pstmt.setInt (1, Env.getAD_Client_ID(getCtx())); + else + pstmt.setInt(1, p_M_Product_Category_ID); + rs = pstmt.executeQuery (); + + while (rs.next()) + { + addLog(0, null, null, rs.getString(1) + " BOM without BOM lines", MProduct.Table_ID, rs.getInt(2)); + } + } catch (SQLException e) { + throw e; + } finally { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + + PreparedStatement upstmt = null; + try { + String update = "UPDATE M_Product SET IsBOM = 'N' WHERE IsBOM = 'Y' AND M_Product_ID NOT IN " + + "(SELECT M_Product_ID FROM M_Product_BOM ) AND "; + if (p_M_Product_Category_ID == 0) + update += "AD_Client_ID= ?"; + else + update += "M_Product_Category_ID= ?"; + upstmt = DB.prepareStatement (update, get_TrxName()); + if (p_M_Product_Category_ID == 0) + upstmt.setInt (1, Env.getAD_Client_ID(getCtx())); + else + upstmt.setInt(1, p_M_Product_Category_ID); + upstmt.executeUpdate(); + } catch (SQLException e) { + throw e; + } finally { + DB.close(upstmt); + upstmt = null; } - - rs.close(); - pstmt.close(); - - String update = "UPDATE M_Product SET ISBOM = 'N' WHERE ISBOM = 'Y' AND M_PRODUCT_ID NOT IN " + - "(SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM ) AND "; - if (p_M_Product_Category_ID == 0) - update += "AD_Client_ID= ?"; - else - update += "M_Product_Category_ID= ?"; - pstmt = null; - pstmt = DB.prepareStatement (update, null); - if (p_M_Product_Category_ID == 0) - pstmt.setInt (1, Env.getAD_Client_ID(getCtx())); - else - pstmt.setInt(1, p_M_Product_Category_ID); - pstmt.executeUpdate(); - pstmt.close(); } @@ -86,42 +99,54 @@ public class BOMFlagValidate extends SvrProcess { { //Select Products where there's a BOM, and there are no lines - String sql = "SELECT NAME FROM M_PRODUCT WHERE ISBOM = 'N' AND " + - "M_PRODUCT_ID IN (SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM ) AND "; + String sql = "SELECT Name, M_Product_ID FROM M_Product WHERE IsBOM = 'N' AND " + + "M_Product_ID IN (SELECT M_Product_ID FROM M_Product_BOM ) AND "; if (p_M_Product_Category_ID == 0) sql += "AD_Client_ID= ?"; else sql += "M_Product_Category_ID= ?"; PreparedStatement pstmt = null; - pstmt = DB.prepareStatement (sql, null); - if (p_M_Product_Category_ID == 0) - pstmt.setInt (1, Env.getAD_Client_ID(getCtx())); - else - pstmt.setInt(1, p_M_Product_Category_ID); - ResultSet rs = pstmt.executeQuery (); - - while (rs.next()) - { - addLog(0, null, null, rs.getString(1) + "Has Been Flagged as BOM as it has BOM lines"); + ResultSet rs = null; + try { + pstmt = DB.prepareStatement (sql, get_TrxName()); + if (p_M_Product_Category_ID == 0) + pstmt.setInt (1, Env.getAD_Client_ID(getCtx())); + else + pstmt.setInt(1, p_M_Product_Category_ID); + rs = pstmt.executeQuery (); + + while (rs.next()) + { + addLog(0, null, null, rs.getString(1) + " not BOM with BOM lines", MProduct.Table_ID, rs.getInt(2)); + } + } catch (SQLException e) { + throw e; + } finally { + DB.close(rs, pstmt); + rs = null; pstmt = null; } - rs.close(); - pstmt.close(); - String update = "UPDATE M_Product SET ISBOM = 'Y' WHERE ISBOM = 'N' AND M_PRODUCT_ID IN " + - "(SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM ) AND "; + String update = "UPDATE M_Product SET ISBOM = 'Y' WHERE IsBOM = 'N' AND M_Product_ID IN " + + "(SELECT M_Product_ID FROM M_Product_BOM ) AND "; if (p_M_Product_Category_ID == 0) update += "AD_Client_ID= ?"; else update += "M_Product_Category_ID= ?"; - pstmt = null; - pstmt = DB.prepareStatement (update, null); - if (p_M_Product_Category_ID == 0) - pstmt.setInt (1, Env.getAD_Client_ID(getCtx())); - else - pstmt.setInt(1, p_M_Product_Category_ID); - pstmt.executeUpdate(); - pstmt.close(); + PreparedStatement upstmt = null; + try { + upstmt = DB.prepareStatement (update, get_TrxName()); + if (p_M_Product_Category_ID == 0) + upstmt.setInt (1, Env.getAD_Client_ID(getCtx())); + else + upstmt.setInt(1, p_M_Product_Category_ID); + upstmt.executeUpdate(); + } catch (SQLException e) { + throw e; + } finally { + DB.close(upstmt); + upstmt = null; + } } diff --git a/org.adempiere.base.process/src/org/compiere/process/BOMValidate.java b/org.adempiere.base.process/src/org/compiere/process/BOMValidate.java index a9bfd16fb0..4faa2514b0 100644 --- a/org.adempiere.base.process/src/org/compiere/process/BOMValidate.java +++ b/org.adempiere.base.process/src/org/compiere/process/BOMValidate.java @@ -99,7 +99,7 @@ public class BOMValidate extends SvrProcess ResultSet rs = null; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql, get_TrxName()); if (p_M_Product_Category_ID == 0) pstmt.setInt (1, AD_Client_ID); else @@ -107,8 +107,8 @@ public class BOMValidate extends SvrProcess rs = pstmt.executeQuery (); while (rs.next ()) { - String info = validateProduct(new MProduct(getCtx(), rs.getInt(1), get_TrxName())); - addLog(0, null, null, info); + String info = validateProduct(new MProduct(getCtx(), rs.getInt("M_Product_ID"), get_TrxName())); + addLog(0, null, null, info, MProduct.Table_ID, rs.getInt("M_Product_ID")); counter++; } } diff --git a/org.adempiere.base.process/src/org/compiere/process/BOMVerify.java b/org.adempiere.base.process/src/org/compiere/process/BOMVerify.java index f48d2d2db9..40d9ca266a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/BOMVerify.java +++ b/org.adempiere.base.process/src/org/compiere/process/BOMVerify.java @@ -39,12 +39,10 @@ public class BOMVerify extends SvrProcess /** Re-Validate */ private boolean p_IsReValidate = false; - /** Product */ - private MProduct m_product = null; /** List of Products */ - private ArrayList foundproducts = new ArrayList(); + private ArrayList foundproducts = new ArrayList(); private ArrayList validproducts = new ArrayList(); - private ArrayList invalidproducts = new ArrayList(); + private ArrayList invalidproducts = new ArrayList(); private ArrayList containinvalidproducts = new ArrayList(); private ArrayList checkedproducts = new ArrayList(); @@ -90,6 +88,7 @@ public class BOMVerify extends SvrProcess // int counter = 0; PreparedStatement pstmt = null; + ResultSet rs = null; String sql = "SELECT M_Product_ID FROM M_Product " + "WHERE IsBOM='Y' AND "; if (p_M_Product_Category_ID == 0) @@ -102,12 +101,12 @@ public class BOMVerify extends SvrProcess int AD_Client_ID = Env.getAD_Client_ID(getCtx()); try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql, get_TrxName()); if (p_M_Product_Category_ID == 0) pstmt.setInt (1, AD_Client_ID); else pstmt.setInt(1, p_M_Product_Category_ID); - ResultSet rs = pstmt.executeQuery (); + rs = pstmt.executeQuery (); while (rs.next ()) { p_M_Product_ID = rs.getInt(1); //ADAXA - validate the product retrieved from database @@ -115,23 +114,15 @@ public class BOMVerify extends SvrProcess counter++; } - rs.close (); - pstmt.close (); - pstmt = null; } catch (Exception e) { - log.log (Level.SEVERE, sql, e); + throw e; } - try + finally { - if (pstmt != null) - pstmt.close (); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; + DB.close(rs, pstmt); + rs = null; pstmt = null; } return "#" + counter; } // doIt @@ -183,7 +174,7 @@ public class BOMVerify extends SvrProcess else if (foundproducts.contains(pp)) { invalid = true; - addLog(0, null, null, product.getValue() + " recursively contains " + pp.getValue()); + addLog(0, null, null, product.getValue() + " recursively contains " + pp.getValue(), MProduct.Table_ID, product.getM_Product_ID()); } else { @@ -223,11 +214,6 @@ public class BOMVerify extends SvrProcess return true; } - - } // validateProduct - - } // BOMValidate - diff --git a/org.adempiere.base.process/src/org/compiere/process/IndentedBOM.java b/org.adempiere.base.process/src/org/compiere/process/IndentedBOM.java index ad2e11baad..a55f4583b9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/IndentedBOM.java +++ b/org.adempiere.base.process/src/org/compiere/process/IndentedBOM.java @@ -24,13 +24,10 @@ import java.util.logging.Level; import org.adempiere.exceptions.FillMandatoryException; import org.compiere.model.MAcctSchema; import org.compiere.model.MCost; -import org.compiere.model.MCostElement; import org.compiere.model.MProduct; import org.compiere.model.MProductBOM; import org.compiere.model.Query; import org.compiere.model.X_T_BOM_Indented; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.process.SvrProcess; import org.compiere.util.Env; /** @@ -49,13 +46,10 @@ public class IndentedBOM extends SvrProcess private int p_C_AcctSchema_ID = 0; private int p_M_Product_ID = 0; private int p_M_CostElement_ID = 0; - private String p_CostingMethod = MCostElement.COSTINGMETHOD_StandardCosting; // private int m_LevelNo = 0; private int m_SeqNo = 0; private MAcctSchema m_as = null; - private BigDecimal m_currentCost = Env.ZERO; - private BigDecimal m_futureCost = Env.ZERO; protected void prepare() { @@ -122,7 +116,7 @@ public class IndentedBOM extends SvrProcess tboml.setLevelNo(m_LevelNo); String pad = ""; if (m_LevelNo > 0) - pad = String.format("%1$" + 4*1 + "s", ""); + pad = String.format("%1$" + 4*m_LevelNo + "s", ""); tboml.setLevels( (m_LevelNo > 0 ? ":" : "") + pad +" " + product.getValue()); // // Set Costs: @@ -183,7 +177,7 @@ public class IndentedBOM extends SvrProcess whereClause.append(MProductBOM.COLUMNNAME_M_Product_ID).append("=?"); params.add(product.get_ID()); - List list = new Query(getCtx(), MProductBOM.Table_Name, whereClause.toString(), null) + List list = new Query(getCtx(), MProductBOM.Table_Name, whereClause.toString(), get_TrxName()) .setParameters(params) .setOnlyActiveRecords(true) .setOrderBy(MProductBOM.COLUMNNAME_Line) diff --git a/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java b/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java index 2c7ad887e5..a53d74f0b9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java +++ b/org.adempiere.base.process/src/org/compiere/process/ProductionProcess.java @@ -5,8 +5,6 @@ import java.util.logging.Level; import org.compiere.model.MProduction; import org.compiere.model.MProductionLine; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.process.SvrProcess; import org.compiere.util.AdempiereSystemError; import org.compiere.util.AdempiereUserError; @@ -24,9 +22,6 @@ public class ProductionProcess extends SvrProcess { private Timestamp p_MovementDate = null; private MProduction m_production = null; private boolean mustBeStocked = false; //not used - private boolean recreate = false; - private boolean issued = false; - //private int p_M_Locator_ID=0; protected void prepare() { @@ -77,7 +72,7 @@ public class ProductionProcess extends SvrProcess { errors.append( lines[i].createTransactions(m_production.getMovementDate(), mustBeStocked) ); //TODO error handling lines[i].setProcessed( true ); - lines[i].save(get_TrxName()); + lines[i].saveEx(get_TrxName()); processed++; } @@ -88,7 +83,7 @@ public class ProductionProcess extends SvrProcess { m_production.setProcessed(true); - m_production.save(get_TrxName()); + m_production.saveEx(get_TrxName()); return processed + " production lines were processed"; } diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java index d401768f29..9ddc83163c 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java @@ -22,7 +22,6 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Timestamp; import java.util.ArrayList; -import java.util.List; import java.util.logging.Level; import org.compiere.model.MBPartner; @@ -35,22 +34,18 @@ import org.compiere.model.MOrderLine; import org.compiere.model.MOrg; import org.compiere.model.MProduct; import org.compiere.model.MProduction; -import org.compiere.model.MProductionLine; import org.compiere.model.MReplenish; import org.compiere.model.MRequisition; import org.compiere.model.MRequisitionLine; import org.compiere.model.MStorage; import org.compiere.model.MWarehouse; import org.compiere.model.X_T_Replenish; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.process.SvrProcess; import org.compiere.util.AdempiereSystemError; import org.compiere.util.AdempiereUserError; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.ReplenishInterface; -import org.compiere.util.Util; import org.eevolution.model.MDDOrder; import org.eevolution.model.MDDOrderLine; @@ -415,7 +410,7 @@ public class ReplenishReportProduction extends SvrProcess if (qto == null) qto = Env.ZERO; replenish.setQtyToOrder(qto); - replenish.save(); + replenish.saveEx(); } } } @@ -470,7 +465,7 @@ public class ReplenishReportProduction extends SvrProcess line.setM_Product_ID(replenish.getM_Product_ID()); line.setQty(replenish.getQtyToOrder()); line.setPrice(); - line.save(); + line.saveEx(); } m_info = "#" + noOrders + info; log.info(m_info); @@ -515,7 +510,7 @@ public class ReplenishReportProduction extends SvrProcess line.setC_BPartner_ID(replenish.getC_BPartner_ID()); line.setQty(replenish.getQtyToOrder()); line.setPrice(); - line.save(); + line.saveEx(); } m_info = "#" + noReqs + info; log.info(m_info); @@ -594,7 +589,7 @@ public class ReplenishReportProduction extends SvrProcess line.setM_AttributeSetInstance_ID(storage.getM_AttributeSetInstance_ID()); line.setM_LocatorTo_ID(M_LocatorTo_ID); // to line.setM_AttributeSetInstanceTo_ID(storage.getM_AttributeSetInstance_ID()); - line.save(); + line.saveEx(); // target = target.subtract(moveQty); if (target.signum() == 0) @@ -728,7 +723,7 @@ public class ReplenishReportProduction extends SvrProcess line.setM_LocatorTo_ID(M_LocatorTo_ID); // to line.setM_AttributeSetInstanceTo_ID(storage.getM_AttributeSetInstance_ID()); line.setIsInvoiced(false); - line.save(); + line.saveEx(); // target = target.subtract(moveQty); if (target.signum() == 0) @@ -745,7 +740,7 @@ public class ReplenishReportProduction extends SvrProcess line.setM_LocatorTo_ID(M_LocatorTo_ID); // to line.setM_AttributeSetInstanceTo_ID(0); line.setIsInvoiced(false); - line.save(); + line.saveEx(); } if (replenishs.length == 0) @@ -813,7 +808,7 @@ public class ReplenishReportProduction extends SvrProcess production.createLines(false); production.setIsCreated("Y"); - production.save(get_TrxName()); + production.saveEx(get_TrxName()); log.fine(production.toString()); noProds++; info += " - " + production.getDocumentNo(); diff --git a/org.adempiere.base.process/src/org/compiere/process/RollUpCosts.java b/org.adempiere.base.process/src/org/compiere/process/RollUpCosts.java index b809eded29..b8f2987ad7 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RollUpCosts.java +++ b/org.adempiere.base.process/src/org/compiere/process/RollUpCosts.java @@ -1,13 +1,8 @@ package org.compiere.process; -import java.math.BigDecimal; import java.util.HashSet; import java.util.logging.Level; -import javax.sql.RowSet; - -import org.compiere.process.ProcessInfoParameter; -import org.compiere.process.SvrProcess; import org.compiere.util.DB; import org.compiere.util.Env; @@ -17,8 +12,6 @@ public class RollUpCosts extends SvrProcess { int category = 0; int product_id = 0; int client_id = 0; - int org_id = 0; - int user_id = 0; int costelement_id = 0; private HashSet processed; @@ -57,11 +50,8 @@ public class RollUpCosts extends SvrProcess { protected String doIt() throws Exception { client_id = Env.getAD_Client_ID(getCtx()); - org_id = Env.getAD_Org_ID(getCtx()); - user_id = Env.getAD_User_ID(getCtx()); - createView(); + createArray(); String result = rollUp(); - deleteView(); return result; } @@ -76,57 +66,45 @@ public class RollUpCosts extends SvrProcess { } else if (category != 0) //roll up for all categories { - String sql = "SELECT M_PRODUCT_ID FROM M_PRODUCT WHERE M_PRODUCT_CATEGORY_ID = " + - category + " AND AD_CLIENT_ID = " + Env.getAD_Client_ID(getCtx()) + - " AND M_PRODUCT_ID IN (SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM)"; - //System.err.println(sql); - RowSet results = DB.getRowSet(sql); - while (results.next()) - { - rollUpCosts(results.getInt(1)); + String sql = "SELECT M_Product_ID FROM M_Product WHERE M_Product_Category_ID = ? AND AD_Client_ID = ? " + + " AND M_Product_ID IN (SELECT M_Product_ID FROM M_Product_BOM)"; + int[] prodids = DB.getIDsEx(get_TrxName(), sql, category, client_id); + for (int prodid : prodids) { + rollUpCosts(prodid); } } else //do it for all products { - String sql = "SELECT M_PRODUCT_ID FROM M_PRODUCT WHERE AD_CLIENT_ID = " + Env.getAD_Client_ID(getCtx()) + - " AND M_PRODUCT_ID IN (SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM)"; - //System.err.println(sql); - RowSet results = DB.getRowSet(sql); - while (results.next()) - { - rollUpCosts(results.getInt(1)); - } + String sql = "SELECT M_Product_ID FROM M_Product WHERE AD_Client_ID = ? " + + " AND M_Product_ID IN (SELECT M_Product_ID FROM M_Product_BOM)"; + int[] prodids = DB.getIDsEx(get_TrxName(), sql, client_id); + for (int prodid : prodids) { + rollUpCosts(prodid); + } } return "Roll Up Complete"; } - protected void createView() throws Exception + protected void createArray() throws Exception { processed = new HashSet(); } - protected void deleteView() - { - } - protected void rollUpCosts(int p_id) throws Exception { - String sql = "SELECT M_ProductBOM_ID FROM M_Product_BOM WHERE M_Product_ID = " + - p_id + " AND AD_Client_ID = " + Env.getAD_Client_ID(getCtx()); - //System.err.println(sql); - RowSet results = DB.getRowSet(sql); + String sql = "SELECT M_ProductBOM_ID FROM M_Product_BOM WHERE M_Product_ID = ? " + + " AND AD_Client_ID = " + client_id; + int[] prodbomids = DB.getIDsEx(get_TrxName(), sql, client_id); - while (results.next()) - { + for (int prodbomid : prodbomids) { if ( !processed.contains(p_id)) { - rollUpCosts(results.getInt(1)); + rollUpCosts(prodbomid); } - } - results.close(); - + } + //once the subproducts costs are accurate, calculate the costs for this product String update = "UPDATE M_Cost set CurrentCostPrice = COALESCE((select Sum (b.BOMQty * c.currentcostprice)" + " FROM M_Product_BOM b INNER JOIN M_Cost c ON (b.M_PRODUCTBOM_ID = c.M_Product_ID) " + @@ -134,14 +112,14 @@ public class RollUpCosts extends SvrProcess { " FutureCostPrice = COALESCE((select Sum (b.BOMQty * c.futurecostprice) FROM M_Product_BOM b " + " INNER JOIN M_Cost c ON (b.M_PRODUCTBOM_ID = c.M_Product_ID) " + " WHERE b.M_Product_ID = " + p_id + " AND M_CostElement_ID = " + costelement_id + "),0)" + - " WHERE M_Product_ID = " + p_id + " AND AD_Client_ID = " + Env.getAD_Client_ID(getCtx()) + + " WHERE M_Product_ID = " + p_id + " AND AD_Client_ID = " + client_id + " AND M_CostElement_ID = " + costelement_id + " AND M_PRODUCT_ID IN (SELECT M_PRODUCT_ID FROM M_PRODUCT_BOM)";; - //System.err.println(sql); DB.executeUpdate(update, get_TrxName()); processed.add(p_id); } + } diff --git a/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java b/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java index 7c5edc8505..d95aae5d18 100644 --- a/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java +++ b/org.adempiere.base.process/src/org/compiere/process/UniversalSubstitution.java @@ -1,12 +1,12 @@ package org.compiere.process; -import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.List; import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.process.SvrProcess; -import org.compiere.util.DB; +import org.compiere.model.MProductBOM; +import org.compiere.model.Query; public class UniversalSubstitution extends SvrProcess { @@ -29,21 +29,22 @@ public class UniversalSubstitution extends SvrProcess { } @Override - protected String doIt() throws Exception { + protected String doIt() throws SQLException { if ( productId == 0 || replacementId == 0 ) throw new AdempiereException("Product and replacement product required"); + List boms = new Query(getCtx(), MProductBOM.Table_Name, "M_ProductBOM_ID=?", get_TrxName()) + .setParameters(productId) + .list(); - String update = "UPDATE M_Product_BOM bb " + - "SET M_PRODUCTBOM_ID = ? " + - "WHERE bb.M_PRODUCTBOM_ID = ?"; - - PreparedStatement pstmt = DB.prepareStatement(update, get_TrxName()); - pstmt.setInt(1, replacementId); - pstmt.setInt(2, productId); - - int count = pstmt.executeUpdate(); + int count = 0; + // Use model class to invalidate the product + for (MProductBOM bom : boms) { + bom.setM_ProductBOM_ID(replacementId); + bom.saveEx(); + count++; + } return count + " BOM products updated"; } diff --git a/org.adempiere.base/src/org/compiere/model/MProduction.java b/org.adempiere.base/src/org/compiere/model/MProduction.java index 523782742c..70b36445f6 100644 --- a/org.adempiere.base/src/org/compiere/model/MProduction.java +++ b/org.adempiere.base/src/org/compiere/model/MProduction.java @@ -6,27 +6,24 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Properties; -import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; -import org.compiere.model.MAttributeSetInstance; -import org.compiere.model.MOrderLine; -import org.compiere.model.MProduct; -import org.compiere.model.MStorage; -import org.compiere.model.X_M_Production; import org.compiere.util.AdempiereUserError; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; public class MProduction extends X_M_Production { + /** + * + */ + private static final long serialVersionUID = -9055468125493188165L; /** * */ /** Log */ private static CLogger m_log = CLogger.getCLogger (MProduction.class); - private static final long serialVersionUID = 1L; private int lineno; private int count; @@ -107,7 +104,7 @@ public class MProduction extends X_M_Production { line.setMovementQty( getProductionQty()); line.setPlannedQty(getProductionQty()); - line.save(); + line.saveEx(); count++; createLines(mustBeStocked, finishedProduct, getProductionQty()); @@ -166,7 +163,7 @@ public class MProduction extends X_M_Production { BOMLine.setM_Locator_ID( defaultLocator ); BOMLine.setQtyUsed(BOMMovementQty ); BOMLine.setPlannedQty( BOMMovementQty ); - BOMLine.save(get_TrxName()); + BOMLine.saveEx(get_TrxName()); lineno = lineno + 10; count++; @@ -180,7 +177,7 @@ public class MProduction extends X_M_Production { BOMLine.setM_Locator_ID( defaultLocator ); BOMLine.setQtyUsed( BOMMovementQty ); BOMLine.setPlannedQty( BOMMovementQty ); - BOMLine.save(get_TrxName()); + BOMLine.saveEx(get_TrxName()); lineno = lineno + 10; count++; @@ -232,7 +229,7 @@ public class MProduction extends X_M_Production { BOMLine.setQtyUsed(BOMLine.getQtyUsed() .add(lineQty)); BOMLine.setPlannedQty(BOMLine.getQtyUsed()); - BOMLine.save(get_TrxName()); + BOMLine.saveEx(get_TrxName()); } // otherwise create new line @@ -245,7 +242,7 @@ public class MProduction extends X_M_Production { BOMLine.setPlannedQty( lineQty); if ( slASI != 0 && locAttribSet != 0 ) // ie non costing attribute BOMLine.setM_AttributeSetInstance_ID(slASI); - BOMLine.save(get_TrxName()); + BOMLine.saveEx(get_TrxName()); lineno = lineno + 10; count++; @@ -270,7 +267,7 @@ public class MProduction extends X_M_Production { BOMLine.setQtyUsed(BOMLine.getQtyUsed() .add(BOMMovementQty)); BOMLine.setPlannedQty(BOMLine.getQtyUsed()); - BOMLine.save(get_TrxName()); + BOMLine.saveEx(get_TrxName()); } // otherwise create new line @@ -282,7 +279,7 @@ public class MProduction extends X_M_Production { BOMLine.setM_Locator_ID( defaultLocator ); BOMLine.setQtyUsed( BOMMovementQty); BOMLine.setPlannedQty( BOMMovementQty); - BOMLine.save(get_TrxName()); + BOMLine.saveEx(get_TrxName()); lineno = lineno + 10; count++; diff --git a/org.adempiere.base/src/org/compiere/model/MProductionLine.java b/org.adempiere.base/src/org/compiere/model/MProductionLine.java index 17330d3726..096243f0c1 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MProductionLine.java @@ -1,22 +1,12 @@ package org.compiere.model; import java.math.BigDecimal; -import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Timestamp; -import java.util.ArrayList; import java.util.List; import java.util.Properties; import java.util.logging.Level; -import org.compiere.model.MAttributeSet; -import org.compiere.model.MAttributeSetInstance; -import org.compiere.model.MInventoryLineMA; -import org.compiere.model.MLocator; -import org.compiere.model.MProduct; -import org.compiere.model.MStorage; -import org.compiere.model.MTransaction; -import org.compiere.model.X_M_ProductionLine; import org.compiere.util.DB; import org.compiere.util.Env; @@ -25,7 +15,8 @@ public class MProductionLine extends X_M_ProductionLine { /** * */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 5939914729719167512L; + private MProduction parent; @@ -208,7 +199,7 @@ public class MProductionLine extends X_M_ProductionLine { storage.setM_Locator_ID(getM_Locator_ID()); storage.setM_Product_ID(getM_Product_ID()); storage.setM_AttributeSetInstance_ID(0); - storage.save(); + storage.saveEx(); } diff --git a/org.adempiere.base/src/org/compiere/model/MProductionLineMA.java b/org.adempiere.base/src/org/compiere/model/MProductionLineMA.java index f452745af1..4fd8b16acd 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductionLineMA.java +++ b/org.adempiere.base/src/org/compiere/model/MProductionLineMA.java @@ -8,11 +8,10 @@ import org.compiere.model.X_M_ProductionLineMA; import org.compiere.util.Env; public class MProductionLineMA extends X_M_ProductionLineMA { - /** * */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -3935841562652510880L; public MProductionLineMA(Properties ctx, int M_ProductionLineMA_ID, String trxName) { @@ -39,6 +38,7 @@ public class MProductionLineMA extends X_M_ProductionLineMA { setM_AttributeSetInstance_ID(asi); setM_ProductionLine_ID(parent.get_ID()); setMovementQty(qty); + setAD_Org_ID(parent.getAD_Org_ID()); } diff --git a/org.adempiere.base/src/org/compiere/model/MStorage.java b/org.adempiere.base/src/org/compiere/model/MStorage.java index 1de94dfc74..cca8d57abd 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorage.java +++ b/org.adempiere.base/src/org/compiere/model/MStorage.java @@ -293,7 +293,7 @@ public class MStorage extends X_M_Storage { sql = "SELECT s.M_Product_ID,s.M_Locator_ID,s.M_AttributeSetInstance_ID," + "s.AD_Client_ID,s.AD_Org_ID,s.IsActive,s.Created,s.CreatedBy,s.Updated,s.UpdatedBy," - + "s.QtyOnHand,s.QtyReserved,s.QtyOrdered,s.DateLastInventory " + + "s.QtyOnHand,s.QtyReserved,s.QtyOrdered,s.DateLastInventory,s.M_Storage_UU " + "FROM M_Storage s" + " INNER JOIN M_Locator l ON (l.M_Locator_ID=s.M_Locator_ID)" + " LEFT OUTER JOIN M_AttributeSetInstance asi ON (s.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID) "; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WTreeBOM.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WTreeBOM.java index e36d8b7e94..dcc7598c3e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WTreeBOM.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WTreeBOM.java @@ -60,7 +60,6 @@ import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Center; -import org.zkoss.zul.DefaultTreeModel; import org.zkoss.zul.DefaultTreeNode; import org.zkoss.zul.North; import org.zkoss.zul.Separator; @@ -251,22 +250,13 @@ public class WTreeBOM extends TreeBOM implements IFormController, EventListener } if (event.getTarget().equals(treeExpand)) { - if (treeExpand.isChecked()) - { - TreeUtils.expandAll(m_tree); - } - else - { - TreeUtils.collapseAll(m_tree); - } + expandOrCollapse(); } // *** Tree *** if (event.getTarget() instanceof Tree ) { Treeitem ti = m_tree.getSelectedItem(); if (ti == null) { - // ADialog.beep(); - // TODO: review what is this beep for - no zk6 equivalent log.log(Level.WARNING, "WTreeBOM.onEvent treeItem=null"); } else @@ -277,6 +267,19 @@ public class WTreeBOM extends TreeBOM implements IFormController, EventListener } } + + private void expandOrCollapse() { + if (treeExpand.isChecked()) + { + if (m_tree.getTreechildren() != null) + TreeUtils.expandAll(m_tree); + } + else + { + if (m_tree.getTreechildren() != null) + TreeUtils.collapseAll(m_tree); + } + } /** * Set the selected node & initiate all listeners @@ -385,15 +388,10 @@ public class WTreeBOM extends TreeBOM implements IFormController, EventListener m_tree.setModel(model); } - // TODO: check zk6 - was: - // int[] path = m_tree.getModel().getPath(parent, m_root); - int[] path = m_tree.getModel().getPath(m_root); - Treeitem ti = m_tree.renderItemByPath(path); - m_tree.setSelectedItem(ti); - ti.setOpen(true); - m_tree.addEventListener(Events.ON_SELECT, this); loadTableBOM(); + + treeExpand.setChecked(false); } private void action_reloadBOM() throws Exception