diff --git a/migration/i3.1/oracle/201603212338_IDEMPIERE-3052.sql b/migration/i3.1/oracle/201603212338_IDEMPIERE-3052.sql new file mode 100644 index 0000000000..e30068b75e --- /dev/null +++ b/migration/i3.1/oracle/201603212338_IDEMPIERE-3052.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3052 Advanced Search on doctype on invoices or orders shows all the doctypes +-- Mar 21, 2016 11:38:20 PM CET +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND COALESCE(C_DocType.DocSubTypeSO,'' '')<>''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_DATE('2016-03-21 23:38:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=133 +; + +SELECT register_migration_script('201603212338_IDEMPIERE-3052.sql') FROM dual +; + diff --git a/migration/i3.1/oracle/201603221737_IDEMPIERE-3057.sql b/migration/i3.1/oracle/201603221737_IDEMPIERE-3057.sql new file mode 100644 index 0000000000..7de443ebf7 --- /dev/null +++ b/migration/i3.1/oracle/201603221737_IDEMPIERE-3057.sql @@ -0,0 +1,19 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3057 2Pack handler for SQL Statements that must not fail +-- Mar 22, 2016 5:34:50 PM CET +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200356,'SQL Mandatory',50004,'SQM',0,0,'Y',TO_DATE('2016-03-22 17:34:50','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-03-22 17:34:50','YYYY-MM-DD HH24:MI:SS'),100,'D','63605262-3ba3-4140-b839-4e5b0f8ad23d') +; + +-- Mar 22, 2016 5:35:42 PM CET +UPDATE AD_Field SET DisplayLogic='@Type@=''D''|Type@=''SQL''|Type@=''SQM''',Updated=TO_DATE('2016-03-22 17:35:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50105 +; + +-- Mar 22, 2016 5:39:53 PM CET +UPDATE AD_Field SET DisplayLogic='@Type@=''SQL''|@Type@=''SQM''',Updated=TO_DATE('2016-03-22 17:39:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50104 +; + +SELECT register_migration_script('201603221737_IDEMPIERE-3057.sql') FROM dual +; + diff --git a/migration/i3.1/oracle/201603222022_IDEMPIERE-3058.sql b/migration/i3.1/oracle/201603222022_IDEMPIERE-3058.sql new file mode 100644 index 0000000000..030be6fd2a --- /dev/null +++ b/migration/i3.1/oracle/201603222022_IDEMPIERE-3058.sql @@ -0,0 +1,23 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3058 Make 2Pack transaction safe (for postgres) +-- Mar 22, 2016 7:30:44 PM CET +INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200076,0,0,TO_DATE('2016-03-22 19:30:38','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2016-03-22 19:30:38','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','2PACK_COMMIT_DDL','N','If set to Y 2Pack tries to behave in PostgreSQL same as with Oracle - committing before and after DDL statements','D','S','112f7659-c30f-45df-a505-ba85c4b6f83a') +; + +-- Mar 22, 2016 8:30:02 PM CET +UPDATE AD_Column SET AD_Reference_ID=30, FKConstraintType=NULL,Updated=TO_DATE('2016-03-22 20:30:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=50025 +; + +-- Mar 22, 2016 9:59:58 PM CET +UPDATE AD_Column SET FieldLength=2000,Updated=TO_DATE('2016-03-22 21:59:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=50073 +; + +-- Mar 22, 2016 10:00:02 PM CET +ALTER TABLE AD_Package_Imp_Detail MODIFY Name NVARCHAR2(2000) DEFAULT NULL +; + +SELECT register_migration_script('201603222022_IDEMPIERE-3058.sql') FROM dual +; + diff --git a/migration/i3.1/oracle/201604281128_IDEMPIERE-3087.sql b/migration/i3.1/oracle/201604281128_IDEMPIERE-3087.sql new file mode 100644 index 0000000000..3e4e53ea22 --- /dev/null +++ b/migration/i3.1/oracle/201604281128_IDEMPIERE-3087.sql @@ -0,0 +1,19 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2405 Implement SaaS support for Setup Wizard +-- Apr 28, 2016 12:59:00 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2016-04-28 12:59:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4986 +; + +-- Apr 28, 2016 12:59:11 PM COT +ALTER TABLE C_BP_Group_Acct MODIFY V_Liability_Services_Acct NUMBER(10) DEFAULT NULL +; + +-- Apr 28, 2016 12:59:11 PM COT +ALTER TABLE C_BP_Group_Acct MODIFY V_Liability_Services_Acct NULL +; + +SELECT register_migration_script('201604281128_IDEMPIERE-3087.sql') FROM dual +; + diff --git a/migration/i3.1/oracle/201604281559_IDEMPIERE-3087.sql b/migration/i3.1/oracle/201604281559_IDEMPIERE-3087.sql new file mode 100644 index 0000000000..3e559a4cf8 --- /dev/null +++ b/migration/i3.1/oracle/201604281559_IDEMPIERE-3087.sql @@ -0,0 +1,79 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2405 Implement SaaS support for Setup Wizard +-- Apr 28, 2016 4:58:48 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2016-04-28 16:58:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4997 +; + +-- Apr 28, 2016 4:58:57 PM COT +ALTER TABLE C_BP_Group_Acct MODIFY UnEarnedRevenue_Acct NUMBER(10) DEFAULT NULL +; + +-- Apr 28, 2016 4:58:57 PM COT +ALTER TABLE C_BP_Group_Acct MODIFY UnEarnedRevenue_Acct NULL +; + +-- Apr 28, 2016 5:03:12 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2016-04-28 17:03:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5279 +; + +-- Apr 28, 2016 5:03:21 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_Asset_Acct NUMBER(10) DEFAULT NULL +; + +-- Apr 28, 2016 5:03:21 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_Asset_Acct NULL +; + +-- Apr 28, 2016 5:05:19 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2016-04-28 17:05:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6496 +; + +-- Apr 28, 2016 5:05:24 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_CashTransfer_Acct NUMBER(10) DEFAULT NULL +; + +-- Apr 28, 2016 5:05:24 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_CashTransfer_Acct NULL +; + +-- Apr 28, 2016 5:07:35 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2016-04-28 17:07:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5280 +; + +-- Apr 28, 2016 5:07:41 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_Differences_Acct NUMBER(10) DEFAULT NULL +; + +-- Apr 28, 2016 5:07:41 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_Differences_Acct NULL +; + +-- Apr 28, 2016 5:09:12 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2016-04-28 17:09:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5281 +; + +-- Apr 28, 2016 5:09:17 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_Expense_Acct NUMBER(10) DEFAULT NULL +; + +-- Apr 28, 2016 5:09:17 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_Expense_Acct NULL +; + +-- Apr 28, 2016 5:10:45 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2016-04-28 17:10:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5282 +; + +-- Apr 28, 2016 5:10:50 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_Receipt_Acct NUMBER(10) DEFAULT NULL +; + +-- Apr 28, 2016 5:10:50 PM COT +ALTER TABLE C_CashBook_Acct MODIFY CB_Receipt_Acct NULL +; + +SELECT register_migration_script('201604281559_IDEMPIERE-3087.sql') FROM dual +; + diff --git a/migration/i3.1/postgresql/201603212338_IDEMPIERE-3052.sql b/migration/i3.1/postgresql/201603212338_IDEMPIERE-3052.sql new file mode 100644 index 0000000000..aa7aae1c85 --- /dev/null +++ b/migration/i3.1/postgresql/201603212338_IDEMPIERE-3052.sql @@ -0,0 +1,8 @@ +-- IDEMPIERE-3052 Advanced Search on doctype on invoices or orders shows all the doctypes +-- Mar 21, 2016 11:38:20 PM CET +UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND COALESCE(C_DocType.DocSubTypeSO,'' '')<>''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@',Updated=TO_TIMESTAMP('2016-03-21 23:38:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=133 +; + +SELECT register_migration_script('201603212338_IDEMPIERE-3052.sql') FROM dual +; + diff --git a/migration/i3.1/postgresql/201603221737_IDEMPIERE-3057.sql b/migration/i3.1/postgresql/201603221737_IDEMPIERE-3057.sql new file mode 100644 index 0000000000..4a00c24928 --- /dev/null +++ b/migration/i3.1/postgresql/201603221737_IDEMPIERE-3057.sql @@ -0,0 +1,16 @@ +-- IDEMPIERE-3057 2Pack handler for SQL Statements that must not fail +-- Mar 22, 2016 5:34:50 PM CET +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200356,'SQL Mandatory',50004,'SQM',0,0,'Y',TO_TIMESTAMP('2016-03-22 17:34:50','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-03-22 17:34:50','YYYY-MM-DD HH24:MI:SS'),100,'D','63605262-3ba3-4140-b839-4e5b0f8ad23d') +; + +-- Mar 22, 2016 5:35:42 PM CET +UPDATE AD_Field SET DisplayLogic='@Type@=''D''|Type@=''SQL''|Type@=''SQM''',Updated=TO_TIMESTAMP('2016-03-22 17:35:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50105 +; + +-- Mar 22, 2016 5:39:53 PM CET +UPDATE AD_Field SET DisplayLogic='@Type@=''SQL''|@Type@=''SQM''',Updated=TO_TIMESTAMP('2016-03-22 17:39:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50104 +; + +SELECT register_migration_script('201603221737_IDEMPIERE-3057.sql') FROM dual +; + diff --git a/migration/i3.1/postgresql/201603222022_IDEMPIERE-3058.sql b/migration/i3.1/postgresql/201603222022_IDEMPIERE-3058.sql new file mode 100644 index 0000000000..f71a241f8c --- /dev/null +++ b/migration/i3.1/postgresql/201603222022_IDEMPIERE-3058.sql @@ -0,0 +1,20 @@ +-- IDEMPIERE-3058 Make 2Pack transaction safe (for postgres) +-- Mar 22, 2016 7:30:44 PM CET +INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200076,0,0,TO_TIMESTAMP('2016-03-22 19:30:38','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2016-03-22 19:30:38','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','2PACK_COMMIT_DDL','N','If set to Y 2Pack tries to behave in PostgreSQL same as with Oracle - committing before and after DDL statements','D','S','112f7659-c30f-45df-a505-ba85c4b6f83a') +; + +-- Mar 22, 2016 8:30:02 PM CET +UPDATE AD_Column SET AD_Reference_ID=30, FKConstraintType=NULL,Updated=TO_TIMESTAMP('2016-03-22 20:30:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=50025 +; + +-- Mar 22, 2016 9:59:58 PM CET +UPDATE AD_Column SET FieldLength=2000,Updated=TO_TIMESTAMP('2016-03-22 21:59:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=50073 +; + +-- Mar 22, 2016 10:00:02 PM CET +INSERT INTO t_alter_column values('ad_package_imp_detail','Name','VARCHAR(2000)',null,'NULL') +; + +SELECT register_migration_script('201603222022_IDEMPIERE-3058.sql') FROM dual +; + diff --git a/migration/i3.1/postgresql/201604281128_IDEMPIERE-3087.sql b/migration/i3.1/postgresql/201604281128_IDEMPIERE-3087.sql new file mode 100644 index 0000000000..995e239f9f --- /dev/null +++ b/migration/i3.1/postgresql/201604281128_IDEMPIERE-3087.sql @@ -0,0 +1,16 @@ +-- IDEMPIERE-2405 Implement SaaS support for Setup Wizard +-- Apr 28, 2016 12:59:00 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-04-28 12:59:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4986 +; + +-- Apr 28, 2016 12:59:11 PM COT +INSERT INTO t_alter_column values('c_bp_group_acct','V_Liability_Services_Acct','NUMERIC(10)',null,'NULL') +; + +-- Apr 28, 2016 12:59:11 PM COT +INSERT INTO t_alter_column values('c_bp_group_acct','V_Liability_Services_Acct',null,'NULL',null) +; + +SELECT register_migration_script('201604281128_IDEMPIERE-3087.sql') FROM dual +; + diff --git a/migration/i3.1/postgresql/201604281559_IDEMPIERE-3087.sql b/migration/i3.1/postgresql/201604281559_IDEMPIERE-3087.sql new file mode 100644 index 0000000000..c8df3b86bf --- /dev/null +++ b/migration/i3.1/postgresql/201604281559_IDEMPIERE-3087.sql @@ -0,0 +1,76 @@ +-- IDEMPIERE-2405 Implement SaaS support for Setup Wizard +-- Apr 28, 2016 4:58:48 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-04-28 16:58:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4997 +; + +-- Apr 28, 2016 4:58:57 PM COT +INSERT INTO t_alter_column values('c_bp_group_acct','UnEarnedRevenue_Acct','NUMERIC(10)',null,'NULL') +; + +-- Apr 28, 2016 4:58:57 PM COT +INSERT INTO t_alter_column values('c_bp_group_acct','UnEarnedRevenue_Acct',null,'NULL',null) +; + +-- Apr 28, 2016 5:03:12 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-04-28 17:03:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5279 +; + +-- Apr 28, 2016 5:03:21 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_Asset_Acct','NUMERIC(10)',null,'NULL') +; + +-- Apr 28, 2016 5:03:21 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_Asset_Acct',null,'NULL',null) +; + +-- Apr 28, 2016 5:05:19 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-04-28 17:05:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6496 +; + +-- Apr 28, 2016 5:05:24 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_CashTransfer_Acct','NUMERIC(10)',null,'NULL') +; + +-- Apr 28, 2016 5:05:24 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_CashTransfer_Acct',null,'NULL',null) +; + +-- Apr 28, 2016 5:07:35 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-04-28 17:07:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5280 +; + +-- Apr 28, 2016 5:07:41 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_Differences_Acct','NUMERIC(10)',null,'NULL') +; + +-- Apr 28, 2016 5:07:41 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_Differences_Acct',null,'NULL',null) +; + +-- Apr 28, 2016 5:09:12 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-04-28 17:09:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5281 +; + +-- Apr 28, 2016 5:09:17 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_Expense_Acct','NUMERIC(10)',null,'NULL') +; + +-- Apr 28, 2016 5:09:17 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_Expense_Acct',null,'NULL',null) +; + +-- Apr 28, 2016 5:10:45 PM COT +UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-04-28 17:10:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5282 +; + +-- Apr 28, 2016 5:10:50 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_Receipt_Acct','NUMERIC(10)',null,'NULL') +; + +-- Apr 28, 2016 5:10:50 PM COT +INSERT INTO t_alter_column values('c_cashbook_acct','CB_Receipt_Acct',null,'NULL',null) +; + +SELECT register_migration_script('201604281559_IDEMPIERE-3087.sql') FROM dual +; + diff --git a/org.adempiere.base.callout/src/org/adempiere/base/callout/CostAdjustmentCalloutFactory.java b/org.adempiere.base.callout/src/org/adempiere/base/callout/CostAdjustmentCalloutFactory.java index 30112e89a7..071361b547 100644 --- a/org.adempiere.base.callout/src/org/adempiere/base/callout/CostAdjustmentCalloutFactory.java +++ b/org.adempiere.base.callout/src/org/adempiere/base/callout/CostAdjustmentCalloutFactory.java @@ -85,9 +85,10 @@ public class CostAdjustmentCalloutFactory implements IColumnCalloutFactory { mTab.setValue(mField, null); return Msg.getMsg(Env.getCtx(), "NoCostingRecord"); } + } else { + mTab.setValue(I_M_InventoryLine.COLUMNNAME_CurrentCostPrice, cost.getCurrentCostPrice()); + mTab.setValue(I_M_InventoryLine.COLUMNNAME_NewCostPrice, cost.getCurrentCostPrice()); } - mTab.setValue(I_M_InventoryLine.COLUMNNAME_CurrentCostPrice, cost.getCurrentCostPrice()); - mTab.setValue(I_M_InventoryLine.COLUMNNAME_NewCostPrice, cost.getCurrentCostPrice()); } } return null; diff --git a/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java b/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java index 4ede242d9c..6dd0c99664 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java @@ -196,7 +196,7 @@ public class InventoryCountCreate extends SvrProcess .append(" AND COALESCE(il.M_AttributeSetInstance_ID,0)=COALESCE(s.M_AttributeSetInstance_ID,0))"); // + " AND il.M_AttributeSetInstance_ID=s.M_AttributeSetInstance_ID)"); // - sql.append(" ORDER BY l.Value, p.Value, s.QtyOnHand DESC"); // Locator/Product + sql.append(" ORDER BY l.Value, p.Value, s.M_AttributeSetInstance_ID, s.DateMaterialPolicy, s.QtyOnHand DESC"); // Locator/Product // int count = 0; PreparedStatement pstmt = null; @@ -279,14 +279,15 @@ public class InventoryCountCreate extends SvrProcess { if (QtyOnHand.signum() == 0) M_AttributeSetInstance_ID = 0; - + + // TODO???? This is not working --- must create one line and multiple MA if (m_line != null && m_line.getM_Locator_ID() == M_Locator_ID && m_line.getM_Product_ID() == M_Product_ID) { if (QtyOnHand.signum() == 0) return 0; - // Same ASI (usually 0) + // Same ASI and Date if (m_line.getM_AttributeSetInstance_ID() == M_AttributeSetInstance_ID && ((dateMPolicy==null && oldDateMPolicy==null) || (dateMPolicy!=null && dateMPolicy.equals(oldDateMPolicy)) || (oldDateMPolicy!=null && oldDateMPolicy.equals(dateMPolicy)))) { m_line.setQtyBook(m_line.getQtyBook().add(QtyOnHand)); @@ -316,7 +317,7 @@ public class InventoryCountCreate extends SvrProcess } // new line m_line = new MInventoryLine (m_inventory, M_Locator_ID, - M_Product_ID, M_AttributeSetInstance_ID, + M_Product_ID, 0, QtyOnHand, QtyOnHand); // book/count oldDateMPolicy = dateMPolicy; diff --git a/org.adempiere.base.process/src/org/compiere/process/TreeMaintenance.java b/org.adempiere.base.process/src/org/compiere/process/TreeMaintenance.java index feeb28d15a..346b7eb3e3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TreeMaintenance.java +++ b/org.adempiere.base.process/src/org/compiere/process/TreeMaintenance.java @@ -21,6 +21,7 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.logging.Level; +import org.compiere.model.MTable; import org.compiere.model.MTree; import org.compiere.model.MTree_Base; import org.compiere.model.MTree_Node; @@ -170,6 +171,41 @@ public class TreeMaintenance extends SvrProcess rs = null; pstmt = null; } + + // Driven by Value + if (tree.isTreeDrivenByValue()) { + sql = new StringBuilder(); + sql.append("SELECT ").append(sourceTableKey) + .append(" FROM ").append(sourceTableName) + .append(" WHERE AD_Client_ID=").append(AD_Client_ID); + if (C_Element_ID > 0) + sql.append(" AND C_Element_ID=").append(C_Element_ID); + if (log.isLoggable(Level.FINER)) log.finer(sql.toString()); + // + MTable table = MTable.get(getCtx(), sourceTableName); + try + { + pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); + rs = pstmt.executeQuery(); + while (rs.next()) + { + int Node_ID = rs.getInt(1); + PO rec = table.getPO(Node_ID, get_TrxName()); + rec.update_Tree(tree.getTreeType()); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "verifyTree", e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + } + StringBuilder msglog = new StringBuilder().append(tree.getName()).append(" Inserted"); addLog(0,null, new BigDecimal(inserts), msglog.toString()); StringBuilder msgreturn = new StringBuilder().append(tree.getName()).append((ok ? " OK" : " Error")); diff --git a/org.adempiere.base/.classpath b/org.adempiere.base/.classpath index dca11cb25b..21a8494ee6 100644 --- a/org.adempiere.base/.classpath +++ b/org.adempiere.base/.classpath @@ -1,9 +1,9 @@ + - diff --git a/org.adempiere.base/META-INF/MANIFEST.MF b/org.adempiere.base/META-INF/MANIFEST.MF index 9fa4627e99..46edd7d5b2 100644 --- a/org.adempiere.base/META-INF/MANIFEST.MF +++ b/org.adempiere.base/META-INF/MANIFEST.MF @@ -4,7 +4,6 @@ Bundle-Name: iDempiere Core Bundle-SymbolicName: org.adempiere.base;singleton:=true Bundle-Version: 3.1.0.qualifier Bundle-ClassPath: base.jar, - bsh-2.0b5.jar, bsh-engine.jar, groovy-engine.jar, jython-engine.jar, @@ -19,7 +18,8 @@ Bundle-ClassPath: base.jar, super-csv-2.2.0.jar, barcode4j-2.1.jar, bcprov-jdk15on-1.46.jar, - passay-1.0.jar + passay-1.0.jar, + bsh-2.0b6.jar Export-Package: bsh, bsh.classpath, bsh.collection, diff --git a/org.adempiere.base/build.properties b/org.adempiere.base/build.properties index 8ad0b737b9..df32192598 100644 --- a/org.adempiere.base/build.properties +++ b/org.adempiere.base/build.properties @@ -1,7 +1,6 @@ bin.includes = META-INF/,\ base.jar,\ plugin.xml,\ - bsh-2.0b5.jar,\ bsh-engine.jar,\ groovy-engine.jar,\ jython-engine.jar,\ @@ -34,7 +33,8 @@ bin.includes = META-INF/,\ schema/,\ barcode4j-2.1.jar,\ bcprov-jdk15on-1.46.jar,\ - passay-1.0.jar + passay-1.0.jar,\ + bsh-2.0b6.jar output.base.jar = bin/ src.includes = schema/ source.base.jar = src/ diff --git a/org.adempiere.base/copyjars.xml b/org.adempiere.base/copyjars.xml index 1fe2a28dad..7a56316f22 100644 --- a/org.adempiere.base/copyjars.xml +++ b/org.adempiere.base/copyjars.xml @@ -1,6 +1,6 @@ - +