hg merge release-3.1 (merge release3.1 into development)
This commit is contained in:
commit
b0d3ca747f
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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
|
||||
;
|
||||
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="bsh-2.0b6.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="passay-1.0.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry exported="true" kind="lib" path="bsh-2.0b5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="bsh-engine.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="groovy-engine.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="jython-engine.jar"/>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<project name="zklibrary" basedir="." default="copy">
|
||||
<target name="copy">
|
||||
<get src="http://central.maven.org/maven2/org/beanshell/bsh/2.0b5/bsh-2.0b5.jar" dest="bsh-2.0b5.jar" usetimestamp="true" verbose="true" retries="5" />
|
||||
<get src="http://central.maven.org/maven2/org/apache-extras/beanshell/bsh/2.0b6/bsh-2.0b6.jar" dest="bsh-2.0b6.jar" usetimestamp="true" verbose="true" retries="5" />
|
||||
<!-- bsf-all-3.0-beta3.jar replace for grovy-engine, jyyhon-enjine, bsh-engine
|
||||
http://mvnrepository.com/artifact/org.apache.bsf/bsf-all/3.0-beta3
|
||||
<get src="http://central.maven.org/maven2/org/apache/bsf/bsf-all/3.0-beta3/bsf-all-3.0-beta3.jar" dest="bsf-all-3.0-beta3.jar" usetimestamp="true" verbose="true" retries="5"/>
|
||||
|
|
|
@ -68,6 +68,7 @@ public class Doc_Production extends Doc
|
|||
return null;
|
||||
} // loadDocumentDetails
|
||||
|
||||
private BigDecimal m_qtyProduced;
|
||||
/**
|
||||
* Load Invoice Line
|
||||
* @param prod production
|
||||
|
@ -76,6 +77,7 @@ public class Doc_Production extends Doc
|
|||
private DocLine[] loadLines(X_M_Production prod)
|
||||
{
|
||||
ArrayList<DocLine> list = new ArrayList<DocLine>();
|
||||
m_qtyProduced = Env.ZERO;
|
||||
String sqlPL = null;
|
||||
if (prod.isUseProductionPlan()){
|
||||
// Production
|
||||
|
@ -115,6 +117,9 @@ public class Doc_Production extends Doc
|
|||
docLine.setProductionBOM(line.getM_Product_ID() == line.getM_ProductionPlan().getM_Product_ID());
|
||||
else
|
||||
docLine.setProductionBOM(line.getM_Product_ID() == prod.getM_Product_ID());
|
||||
if (docLine.isProductionBOM()) {
|
||||
m_qtyProduced = m_qtyProduced.add(line.getMovementQty());
|
||||
}
|
||||
//
|
||||
if (log.isLoggable(Level.FINE)) log.fine(docLine.toString());
|
||||
list.add (docLine);
|
||||
|
@ -195,9 +200,22 @@ public class Doc_Production extends Doc
|
|||
|
||||
if (!parentBomPro.equals(parentEndPro))
|
||||
continue;
|
||||
//pb changed this 20/10/06
|
||||
if (!line0.isProductionBOM())
|
||||
bomCost = bomCost.add(line0.getProductCosts(as, line.getAD_Org_ID(), false).setScale(2,BigDecimal.ROUND_HALF_UP));
|
||||
if (!line0.isProductionBOM()) {
|
||||
// get cost of children
|
||||
MCostDetail cd0 = MCostDetail.get (as.getCtx(), "M_ProductionLine_ID=?",
|
||||
line0.get_ID(), line0.getM_AttributeSetInstance_ID(), as.getC_AcctSchema_ID(), getTrxName());
|
||||
BigDecimal costs0;
|
||||
if (cd0 != null) {
|
||||
costs0 = cd0.getAmt();
|
||||
} else {
|
||||
costs0 = line0.getProductCosts(as, line0.getAD_Org_ID(), false);
|
||||
}
|
||||
bomCost = bomCost.add(costs0.setScale(2,BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
}
|
||||
if (line.getQty().compareTo(m_qtyProduced) != 0) {
|
||||
BigDecimal factor = line.getQty().divide(m_qtyProduced, 12, BigDecimal.ROUND_HALF_UP);
|
||||
bomCost = bomCost.multiply(factor).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
int precision = as.getStdPrecision();
|
||||
BigDecimal variance = (costs.setScale(precision, BigDecimal.ROUND_HALF_UP)).subtract(bomCost.negate());
|
||||
|
|
|
@ -51,7 +51,12 @@ public class MColumn extends X_AD_Column
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -7261365443985547106L;
|
||||
private static final long serialVersionUID = 3082823885314140209L;
|
||||
|
||||
public static MColumn get (Properties ctx, int AD_Column_ID)
|
||||
{
|
||||
return get(ctx, AD_Column_ID, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get MColumn from Cache
|
||||
|
@ -59,13 +64,15 @@ public class MColumn extends X_AD_Column
|
|||
* @param AD_Column_ID id
|
||||
* @return MColumn
|
||||
*/
|
||||
public static MColumn get (Properties ctx, int AD_Column_ID)
|
||||
public static MColumn get(Properties ctx, int AD_Column_ID, String trxName)
|
||||
{
|
||||
Integer key = new Integer (AD_Column_ID);
|
||||
MColumn retValue = (MColumn) s_cache.get (key);
|
||||
if (retValue != null)
|
||||
if (retValue != null) {
|
||||
retValue.set_TrxName(trxName);
|
||||
return retValue;
|
||||
retValue = new MColumn (ctx, AD_Column_ID, null);
|
||||
}
|
||||
retValue = new MColumn (ctx, AD_Column_ID, trxName);
|
||||
if (retValue.get_ID () != 0)
|
||||
s_cache.put (key, retValue);
|
||||
return retValue;
|
||||
|
@ -84,15 +91,21 @@ public class MColumn extends X_AD_Column
|
|||
return table.getColumn(columnName);
|
||||
} // get
|
||||
|
||||
public static String getColumnName (Properties ctx, int AD_Column_ID)
|
||||
{
|
||||
return getColumnName (ctx, AD_Column_ID, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Column Name
|
||||
* @param ctx context
|
||||
* @param AD_Column_ID id
|
||||
* @param trxName transaction
|
||||
* @return Column Name or null
|
||||
*/
|
||||
public static String getColumnName (Properties ctx, int AD_Column_ID)
|
||||
public static String getColumnName (Properties ctx, int AD_Column_ID, String trxName)
|
||||
{
|
||||
MColumn col = MColumn.get(ctx, AD_Column_ID);
|
||||
MColumn col = MColumn.get(ctx, AD_Column_ID, trxName);
|
||||
if (col.get_ID() == 0)
|
||||
return null;
|
||||
return col.getColumnName();
|
||||
|
@ -709,9 +722,12 @@ public class MColumn extends X_AD_Column
|
|||
} else if (DisplayType.Table == refid || DisplayType.Search == refid) {
|
||||
X_AD_Reference ref = new X_AD_Reference(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
|
||||
if (X_AD_Reference.VALIDATIONTYPE_TableValidation.equals(ref.getValidationType())) {
|
||||
MRefTable rt = new MRefTable(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
|
||||
if (rt != null)
|
||||
foreignTable = rt.getAD_Table().getTableName();
|
||||
int cnt = DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM AD_Ref_Table WHERE AD_Reference_ID=?", getAD_Reference_Value_ID());
|
||||
if (cnt == 1) {
|
||||
MRefTable rt = new MRefTable(getCtx(), getAD_Reference_Value_ID(), get_TrxName());
|
||||
if (rt != null)
|
||||
foreignTable = rt.getAD_Table().getTableName();
|
||||
}
|
||||
}
|
||||
} else if (DisplayType.List == refid || DisplayType.Payment == refid) {
|
||||
foreignTable = "AD_Ref_List";
|
||||
|
|
|
@ -74,7 +74,7 @@ public class MIndexColumn extends X_AD_IndexColumn {
|
|||
if (sql != null && sql.length() > 0)
|
||||
return sql;
|
||||
int AD_Column_ID = getAD_Column_ID();
|
||||
return MColumn.getColumnName(getCtx(), AD_Column_ID);
|
||||
return MColumn.getColumnName(getCtx(), AD_Column_ID, get_TrxName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -200,7 +200,8 @@ public class MProductionLine extends X_M_ProductionLine {
|
|||
}
|
||||
else
|
||||
{
|
||||
MStorageOnHand storage = MStorageOnHand.getCreate(Env.getCtx(), getM_Locator_ID(), getM_Product_ID(), 0, date, get_TrxName(), true);
|
||||
MStorageOnHand storage = MStorageOnHand.getCreate(Env.getCtx(), getM_Locator_ID(), getM_Product_ID(),
|
||||
asi.get_ID(), date, get_TrxName(), true);
|
||||
|
||||
BigDecimal lineQty = qtyToMove;
|
||||
MAttributeSetInstance slASI = new MAttributeSetInstance(getCtx(),
|
||||
|
@ -239,6 +240,9 @@ public class MProductionLine extends X_M_ProductionLine {
|
|||
storage.addQtyOnHand(lineQty.negate());
|
||||
qtyToMove = qtyToMove.subtract(lineQty);
|
||||
if (log.isLoggable(Level.FINE))log.log(Level.FINE, getLine() + " Qty moved = " + lineQty + ", Remaining = " + qtyToMove );
|
||||
} else {
|
||||
errorString.append( "Storage doesn't match ASI " + prod.toString() + " / "
|
||||
+ slASIString + " vs. " + asiString + "\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -39,10 +39,10 @@ import org.compiere.util.DisplayType;
|
|||
*/
|
||||
public class MSysConfig extends X_AD_SysConfig
|
||||
{
|
||||
/**
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5124493725187310483L;
|
||||
private static final long serialVersionUID = 5139119853639605887L;
|
||||
|
||||
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
|
||||
public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS";
|
||||
|
@ -130,6 +130,7 @@ public class MSysConfig extends X_AD_SysConfig
|
|||
public static final String SYSTEM_IN_MAINTENANCE_MODE = "SYSTEM_IN_MAINTENANCE_MODE";
|
||||
public static final String SYSTEM_INSERT_CHANGELOG = "SYSTEM_INSERT_CHANGELOG";
|
||||
public static final String SYSTEM_NATIVE_SEQUENCE = "SYSTEM_NATIVE_SEQUENCE";
|
||||
public static final String TWOPACK_COMMIT_DDL = "2PACK_COMMIT_DDL";
|
||||
public static final String TWOPACK_HANDLE_TRANSLATIONS = "2PACK_HANDLE_TRANSLATIONS";
|
||||
public static final String USE_EMAIL_FOR_LOGIN = "USE_EMAIL_FOR_LOGIN";
|
||||
public static final String USER_LOCKING_MAX_ACCOUNT_LOCK_MINUTES = "USER_LOCKING_MAX_ACCOUNT_LOCK_MINUTES";
|
||||
|
|
|
@ -107,7 +107,7 @@ public abstract class PO
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8237905660667141657L;
|
||||
private static final long serialVersionUID = -2997116608353367498L;
|
||||
|
||||
public static final String LOCAL_TRX_PREFIX = "POSave";
|
||||
|
||||
|
@ -3897,7 +3897,7 @@ public abstract class PO
|
|||
* @param treeType MTree TREETYPE_*
|
||||
* @return true if inserted
|
||||
*/
|
||||
protected void update_Tree (String treeType)
|
||||
public void update_Tree (String treeType)
|
||||
{
|
||||
int idxValueCol = get_ColumnIndex("Value");
|
||||
if (idxValueCol < 0)
|
||||
|
@ -3919,8 +3919,13 @@ public abstract class PO
|
|||
parameters = new Object[]{treeType, this.get_Table_ID()};
|
||||
} else {
|
||||
sourceTableName = MTree_Base.getSourceTableName(treeType);
|
||||
whereTree = "TreeType=?";
|
||||
parameters = new Object[]{treeType};
|
||||
if (MTree_Base.TREETYPE_ElementValue.equals(treeType) && this instanceof I_C_ElementValue) {
|
||||
whereTree = "TreeType=? AND AD_Tree_ID=?";
|
||||
parameters = new Object[]{treeType, ((I_C_ElementValue)this).getC_Element().getAD_Tree_ID()};
|
||||
} else {
|
||||
whereTree = "TreeType=?";
|
||||
parameters = new Object[]{treeType};
|
||||
}
|
||||
}
|
||||
String updateSeqNo = "UPDATE " + tableName + " SET SeqNo=SeqNo+1 WHERE Parent_ID=? AND SeqNo>=? AND AD_Tree_ID=?";
|
||||
String update = "UPDATE " + tableName + " SET SeqNo=?, Parent_ID=? WHERE Node_ID=? AND AD_Tree_ID=?";
|
||||
|
@ -3935,7 +3940,12 @@ public abstract class PO
|
|||
|
||||
for (MTree_Base tree : trees) {
|
||||
if (tree.isTreeDrivenByValue()) {
|
||||
int newParentID = retrieveIdOfParentValue(value, sourceTableName, getAD_Client_ID(), get_TrxName());
|
||||
int newParentID = -1;
|
||||
if (I_C_ElementValue.Table_Name.equals(sourceTableName)) {
|
||||
newParentID = retrieveIdOfElementValue(value, getAD_Client_ID(), ((I_C_ElementValue)this).getC_Element().getC_Element_ID(), get_TrxName());
|
||||
} else {
|
||||
newParentID = retrieveIdOfParentValue(value, sourceTableName, getAD_Client_ID(), get_TrxName());
|
||||
}
|
||||
int seqNo = DB.getSQLValueEx(get_TrxName(), selMinSeqNo, newParentID, tree.getAD_Tree_ID(), value);
|
||||
if (seqNo == -1)
|
||||
seqNo = DB.getSQLValueEx(get_TrxName(), selMaxSeqNo, newParentID, tree.getAD_Tree_ID(), value);
|
||||
|
@ -3945,6 +3955,21 @@ public abstract class PO
|
|||
}
|
||||
} // update_Tree
|
||||
|
||||
/** Returns the summary node from C_ElementValue with the corresponding value */
|
||||
private int retrieveIdOfElementValue(String value, int clientID, int elementID, String trxName)
|
||||
{
|
||||
String sql = "SELECT C_ElementValue_ID FROM C_ElementValue WHERE IsSummary='Y' AND AD_Client_ID=? AND C_Element_ID=? AND Value=?";
|
||||
int pos = value.length()-1;
|
||||
while (pos > 0) {
|
||||
String testParentValue = value.substring(0, pos);
|
||||
int parentID = DB.getSQLValueEx(trxName, sql, clientID, elementID, testParentValue);
|
||||
if (parentID > 0)
|
||||
return parentID;
|
||||
pos--;
|
||||
}
|
||||
return 0; // rootID
|
||||
}
|
||||
|
||||
/** Returns the summary node with the corresponding value */
|
||||
public static int retrieveIdOfParentValue(String value, String tableName, int clientID, String trxName)
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@ public class X_AD_Package_Exp_Detail extends PO implements I_AD_Package_Exp_Deta
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20151030L;
|
||||
private static final long serialVersionUID = 20160322L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_AD_Package_Exp_Detail (Properties ctx, int AD_Package_Exp_Detail_ID, String trxName)
|
||||
|
@ -913,6 +913,8 @@ public class X_AD_Package_Exp_Detail extends PO implements I_AD_Package_Exp_Deta
|
|||
public static final String TYPE_ModelValidator = "MV";
|
||||
/** Entity Type = ET */
|
||||
public static final String TYPE_EntityType = "ET";
|
||||
/** SQL Mandatory = SQM */
|
||||
public static final String TYPE_SQLMandatory = "SQM";
|
||||
/** Set Type.
|
||||
@param Type
|
||||
Type of Validation (SQL, Java Script, Java Language)
|
||||
|
|
|
@ -152,6 +152,10 @@
|
|||
class="org.adempiere.pipo2.handler.SQLStatementElementHandler"
|
||||
id="SQLStatement">
|
||||
</handler>
|
||||
<handler
|
||||
class="org.adempiere.pipo2.handler.SQLMandatoryElementHandler"
|
||||
id="SQLMandatory">
|
||||
</handler>
|
||||
<handler
|
||||
class="org.adempiere.pipo2.handler.ReferenceElementHandler"
|
||||
id="AD_Reference">
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.adempiere.pipo2.exception.POSaveFailedException;
|
|||
import org.compiere.model.I_AD_Column;
|
||||
import org.compiere.model.I_AD_Table;
|
||||
import org.compiere.model.MColumn;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.model.X_AD_Column;
|
||||
import org.compiere.model.X_AD_Element;
|
||||
|
@ -260,8 +261,10 @@ public class ColumnElementHandler extends AbstractElementHandler {
|
|||
log.info(sql);
|
||||
|
||||
//make it consistent for oracle and postgresql
|
||||
if (!trx.commit())
|
||||
return -1;
|
||||
if (MSysConfig.getBooleanValue(MSysConfig.TWOPACK_COMMIT_DDL, false)) {
|
||||
if (!trx.commit())
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sql.indexOf(DB.SQLSTATEMENT_SEPARATOR) == -1) {
|
||||
int ret = DB.executeUpdate(sql, false, trx.getTrxName());
|
||||
|
@ -279,7 +282,9 @@ public class ColumnElementHandler extends AbstractElementHandler {
|
|||
}
|
||||
}
|
||||
}
|
||||
trx.commit(true);
|
||||
if (MSysConfig.getBooleanValue(MSysConfig.TWOPACK_COMMIT_DDL, false)) {
|
||||
trx.commit(true);
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,142 @@
|
|||
/**********************************************************************
|
||||
* This file is part of iDempiere ERP Open Source *
|
||||
* http://www.idempiere.org *
|
||||
* *
|
||||
* Copyright (C) Contributors *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License *
|
||||
* as published by the Free Software Foundation; either version 2 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
|
||||
* MA 02110-1301, USA. *
|
||||
* *
|
||||
* Contributors: *
|
||||
* - Trek Global *
|
||||
* - Carlos Ruiz - globalqss *
|
||||
**********************************************************************/
|
||||
|
||||
package org.adempiere.pipo2.handler;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.Statement;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.xml.transform.sax.TransformerHandler;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.adempiere.pipo2.AbstractElementHandler;
|
||||
import org.adempiere.pipo2.Element;
|
||||
import org.adempiere.pipo2.PIPOContext;
|
||||
import org.adempiere.pipo2.PackOut;
|
||||
import org.adempiere.pipo2.PackoutItem;
|
||||
import org.adempiere.pipo2.SQLElementParameters;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.AttributesImpl;
|
||||
|
||||
public class SQLMandatoryElementHandler extends AbstractElementHandler {
|
||||
|
||||
public void startElement(PIPOContext ctx, Element element) throws SAXException {
|
||||
String elementValue = element.getElementValue();
|
||||
|
||||
log.info(elementValue);
|
||||
String DBType = getStringValue(element, "DBType");
|
||||
String sql = getStringValue(element, "statement");
|
||||
if (sql.endsWith(";") && !(sql.toLowerCase().endsWith("end;")))
|
||||
sql = sql.substring(0, sql.length() - 1);
|
||||
sql = Env.parseContext(Env.getCtx(), 0, sql, false);
|
||||
PreparedStatement pstmt = null;
|
||||
X_AD_Package_Imp_Detail impDetail = createImportDetail(ctx, element.qName, "", 0);
|
||||
try {
|
||||
pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
||||
if (DBType.equals("ALL")) {
|
||||
int n = pstmt.executeUpdate();
|
||||
if (log.isLoggable(Level.INFO)) log.info("Executed SQL Mandatory: "+ getStringValue(element, "statement") + " ReturnValue="+n);
|
||||
} else if (DB.isOracle() && DBType.equals("Oracle")) {
|
||||
int n = pstmt.executeUpdate();
|
||||
if (log.isLoggable(Level.INFO)) log.info("Executed SQL Mandatory for Oracle: "+ getStringValue(element, "statement") + " ReturnValue="+n);
|
||||
} else if (DB.isPostgreSQL()
|
||||
&& ( DBType.equals("Postgres")
|
||||
|| DBType.equals("PostgreSQL") // backward compatibility with old packages developed by hand
|
||||
)
|
||||
) {
|
||||
// Avoid convert layer - command specific for postgresql
|
||||
//
|
||||
// pstmt = DB.prepareStatement(sql, getTrxName(ctx));
|
||||
// pstmt.executeUpdate();
|
||||
//
|
||||
Statement stmt = null;
|
||||
try {
|
||||
stmt = pstmt.getConnection().createStatement();
|
||||
int n = stmt.executeUpdate (sql);
|
||||
if (log.isLoggable(Level.INFO)) log.info("Executed SQL Mandatory for PostgreSQL: "+ getStringValue(element,"statement") + " ReturnValue="+n);
|
||||
} finally {
|
||||
DB.close(stmt);
|
||||
stmt = null;
|
||||
}
|
||||
}
|
||||
logImportDetail (ctx, impDetail, 1, "SQLMandatory",1,"Execute");
|
||||
ctx.packIn.getNotifier().addSuccessLine("-> " + sql);
|
||||
} catch (Exception e) {
|
||||
ctx.packIn.getNotifier().addFailureLine("SQL Mandatory failed, error (" + e.getLocalizedMessage() + "):");
|
||||
logImportDetail (ctx, impDetail, 0, "SQLMandatory",1,"Execute");
|
||||
ctx.packIn.getNotifier().addFailureLine("-> " + sql);
|
||||
log.log(Level.SEVERE,"SQLMandatory", e);
|
||||
throw new AdempiereException(e);
|
||||
} finally {
|
||||
DB.close(pstmt);
|
||||
pstmt = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void endElement(PIPOContext ctx, Element element) throws SAXException {
|
||||
}
|
||||
|
||||
public void create(PIPOContext ctx, TransformerHandler document)
|
||||
throws SAXException {
|
||||
String SQLMandatory = Env.getContext(ctx.ctx, SQLElementParameters.SQL_STATEMENT);
|
||||
String DBType = Env.getContext(ctx.ctx, SQLElementParameters.DB_TYPE);
|
||||
AttributesImpl atts = new AttributesImpl();
|
||||
addTypeName(atts, "custom");
|
||||
document.startElement("","","SQLMandatory",atts);
|
||||
createSQLStatmentBinding(document, SQLMandatory, DBType);
|
||||
document.endElement("","","SQLMandatory");
|
||||
}
|
||||
|
||||
private void createSQLStatmentBinding( TransformerHandler document, String sqlMandatory, String DBType) throws SAXException
|
||||
{
|
||||
document.startElement("","","DBType", new AttributesImpl());
|
||||
char[] contents = DBType.toCharArray();
|
||||
document.characters(contents,0,contents.length);
|
||||
document.endElement("","","DBType");
|
||||
|
||||
document.startElement("","","statement", new AttributesImpl());
|
||||
contents = sqlMandatory.toCharArray();
|
||||
document.startCDATA();
|
||||
document.characters(contents,0,contents.length);
|
||||
document.endCDATA();
|
||||
document.endElement("","","statement");
|
||||
|
||||
}
|
||||
|
||||
public void packOut(PackOut packout, TransformerHandler packoutHandler, TransformerHandler docHandler,int field) throws Exception
|
||||
{
|
||||
PackoutItem detail = packout.getCurrentPackoutItem();
|
||||
Env.setContext(packout.getCtx().ctx, SQLElementParameters.SQL_STATEMENT, (String)detail.getProperty(SQLElementParameters.SQL_STATEMENT));
|
||||
Env.setContext(packout.getCtx().ctx, SQLElementParameters.DB_TYPE, (String)detail.getProperty(SQLElementParameters.DB_TYPE));
|
||||
this.create(packout.getCtx(), packoutHandler);
|
||||
packout.getCtx().ctx.remove(SQLElementParameters.SQL_STATEMENT);
|
||||
packout.getCtx().ctx.remove(SQLElementParameters.DB_TYPE);
|
||||
}
|
||||
}
|
|
@ -104,10 +104,10 @@ public class SQLStatementElementHandler extends AbstractElementHandler {
|
|||
}
|
||||
savepoint = null;
|
||||
}
|
||||
ctx.packIn.getNotifier().addFailureLine("SQL statement failed but ignored, error (" + e.getLocalizedMessage() + "): " + sql);
|
||||
ctx.packIn.getNotifier().addFailureLine("SQL statement failed but ignored, error (" + e.getLocalizedMessage() + "): ");
|
||||
logImportDetail (ctx, impDetail, 0, "SQLStatement",1,"Execute");
|
||||
ctx.packIn.getNotifier().addFailureLine("-> " + sql);
|
||||
log.log(Level.SEVERE,"SQLSatement", e);
|
||||
log.log(Level.SEVERE,"SQLStatement", e);
|
||||
} finally {
|
||||
DB.close(pstmt);
|
||||
pstmt = null;
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.adempiere.pipo2.PoFiller;
|
|||
import org.adempiere.pipo2.exception.DatabaseAccessException;
|
||||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||
import org.compiere.model.I_AD_Table;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.model.MTableIndex;
|
||||
import org.compiere.model.MViewComponent;
|
||||
|
@ -126,12 +127,16 @@ public class TableElementHandler extends AbstractElementHandler {
|
|||
private int validateDatabaseView(PIPOContext ctx, MTable table)
|
||||
{
|
||||
Trx trx = Trx.get(getTrxName(ctx), true);
|
||||
if (!trx.commit())
|
||||
return 0;
|
||||
if (MSysConfig.getBooleanValue(MSysConfig.TWOPACK_COMMIT_DDL, false)) {
|
||||
if (!trx.commit())
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
DatabaseViewValidate.validateDatabaseView(ctx.ctx, table, trx.getTrxName(), null);
|
||||
trx.commit(true);
|
||||
if (MSysConfig.getBooleanValue(MSysConfig.TWOPACK_COMMIT_DDL, false)) {
|
||||
trx.commit(true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||
trx.rollback();
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.adempiere.pipo2.exception.DatabaseAccessException;
|
|||
import org.adempiere.pipo2.exception.POSaveFailedException;
|
||||
import org.compiere.model.MIndexColumn;
|
||||
import org.compiere.model.MMessage;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.MTableIndex;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
import org.compiere.process.TableIndexValidate;
|
||||
|
@ -102,12 +103,16 @@ public class TableIndexElementHandler extends AbstractElementHandler {
|
|||
private int validateTableIndex(PIPOContext ctx, MTableIndex tableIndex)
|
||||
{
|
||||
Trx trx = Trx.get(getTrxName(ctx), true);
|
||||
if (!trx.commit())
|
||||
return 0;
|
||||
if (MSysConfig.getBooleanValue(MSysConfig.TWOPACK_COMMIT_DDL, false)) {
|
||||
if (!trx.commit())
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
TableIndexValidate.validateTableIndex(ctx.ctx, tableIndex, trx.getTrxName(), null);
|
||||
trx.commit(true);
|
||||
if (MSysConfig.getBooleanValue(MSysConfig.TWOPACK_COMMIT_DDL, false)) {
|
||||
trx.commit(true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||
trx.rollback();
|
||||
|
|
|
@ -37,6 +37,7 @@ import java.util.zip.ZipFile;
|
|||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.model.X_AD_Package_Imp_Detail;
|
||||
|
@ -175,10 +176,12 @@ public class PackIn {
|
|||
}
|
||||
msg = "End Parser";
|
||||
log.info(msg);
|
||||
if (handler.getUnresolvedCount() > 0)
|
||||
handler.dumpUnresolvedElements();
|
||||
msg = "Processed="+handler.getElementsProcessed()+" Un-Resolved="+handler.getUnresolvedCount();
|
||||
getNotifier().addStatusLine(msg);
|
||||
if (handler.getUnresolvedCount() > 0) {
|
||||
handler.dumpUnresolvedElements();
|
||||
throw new AdempiereException("Unresolved elements");
|
||||
}
|
||||
return msg;
|
||||
} catch (Exception e) {
|
||||
log.log(Level.SEVERE, "importXML:", e);
|
||||
|
|
|
@ -297,8 +297,6 @@ public class PackInHandler extends DefaultHandler {
|
|||
else
|
||||
elementValue = uri + localName;
|
||||
|
||||
X_AD_Package_Imp packageImp = new X_AD_Package_Imp(m_ctx.ctx, AD_Package_Imp_ID, null);
|
||||
packageImp.setProcessed(true);
|
||||
if (elementValue.equals("idempiere")){
|
||||
processDeferElements();
|
||||
|
||||
|
@ -314,14 +312,8 @@ public class PackInHandler extends DefaultHandler {
|
|||
}
|
||||
packIn.getNotifier().addStatusLine(packageStatus);
|
||||
|
||||
//Update package history log with package status
|
||||
packageImp.setPK_Status(packageStatus);
|
||||
packageImp.saveEx();
|
||||
|
||||
//Update package list with package status
|
||||
X_AD_Package_Imp_Inst packageInst = new X_AD_Package_Imp_Inst(m_ctx.ctx, AD_Package_Imp_Inst_ID, null);
|
||||
packageInst.setPK_Status(packageStatus);
|
||||
packageInst.saveEx();
|
||||
updPackageImpNoTrx();
|
||||
updPackageImpInstNoTrx();
|
||||
|
||||
//reset
|
||||
setupHandlers();
|
||||
|
@ -334,23 +326,34 @@ public class PackInHandler extends DefaultHandler {
|
|||
} catch (RuntimeException re) {
|
||||
packageStatus = "Import Failed";
|
||||
packIn.getNotifier().addStatusLine(packageStatus);
|
||||
//Update package history log with package status
|
||||
packageImp.setPK_Status(packageStatus);
|
||||
packageImp.saveEx();
|
||||
updPackageImpNoTrx();
|
||||
throw re;
|
||||
} catch (SAXException se) {
|
||||
packageStatus = "Import Failed";
|
||||
packIn.getNotifier().addStatusLine(packageStatus);
|
||||
//Update package history log with package status
|
||||
packageImp.setPK_Status(packageStatus);
|
||||
packageImp.saveEx();
|
||||
updPackageImpNoTrx();
|
||||
throw se;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // endElement
|
||||
|
||||
private void processDeferElements() throws SAXException {
|
||||
private void updPackageImpNoTrx() {
|
||||
// NOTE: Updating out of model to avoid change log insert that can cause locks
|
||||
//Update package history log with package status
|
||||
DB.executeUpdateEx("UPDATE AD_Package_Imp SET Processed=?, PK_Status=?, UpdatedBy=?, Updated=SYSDATE WHERE AD_Package_Imp_ID=?",
|
||||
new Object[] {"Y", packageStatus, Env.getAD_User_ID(m_ctx.ctx), AD_Package_Imp_ID},
|
||||
null);
|
||||
}
|
||||
|
||||
private void updPackageImpInstNoTrx() {
|
||||
// NOTE: Updating out of model to avoid change log insert that can cause locks
|
||||
DB.executeUpdateEx("UPDATE AD_Package_Imp_Inst SET PK_Status=?, UpdatedBy=?, Updated=SYSDATE WHERE AD_Package_Imp_Inst_ID=?",
|
||||
new Object[] {packageStatus, Env.getAD_User_ID(m_ctx.ctx), AD_Package_Imp_Inst_ID},
|
||||
null);
|
||||
}
|
||||
|
||||
private void processDeferElements() throws SAXException {
|
||||
|
||||
if (defer.isEmpty()) return;
|
||||
|
||||
|
|
|
@ -183,6 +183,8 @@ public class PackOutProcess extends SvrProcess
|
|||
return I_AD_Role.Table_Name;
|
||||
else if (X_AD_Package_Exp_Detail.TYPE_SQLStatement.equals(type))
|
||||
return "SQLStatement";
|
||||
else if (X_AD_Package_Exp_Detail.TYPE_SQLMandatory.equals(type))
|
||||
return "SQLMandatory";
|
||||
else if (X_AD_Package_Exp_Detail.TYPE_Table.equals(type))
|
||||
return I_AD_Table.Table_Name;
|
||||
else if (X_AD_Package_Exp_Detail.TYPE_Window.equals(type))
|
||||
|
@ -202,7 +204,7 @@ public class PackOutProcess extends SvrProcess
|
|||
if (MPackageExpDetail.TYPE_Data.equals(type)) {
|
||||
properties.put(DataElementParameters.AD_TABLE_ID, dtl.getAD_Table_ID());
|
||||
properties.put(DataElementParameters.SQL_STATEMENT, dtl.getSQLStatement());
|
||||
} else if (MPackageExpDetail.TYPE_SQLStatement.equals(type)) {
|
||||
} else if (MPackageExpDetail.TYPE_SQLStatement.equals(type) || MPackageExpDetail.TYPE_SQLMandatory.equals(type)) {
|
||||
properties.put(SQLElementParameters.SQL_STATEMENT, dtl.getSQLStatement());
|
||||
properties.put(SQLElementParameters.DB_TYPE, dtl.getDBType());
|
||||
} else if (MPackageExpDetail.TYPE_File_CodeOrOther.equals(type)) {
|
||||
|
|
|
@ -90,7 +90,7 @@ public class Incremental2PackActivator implements BundleActivator, ServiceTracke
|
|||
// e.g. 1.0.0.qualifier, check only the "1.0.0" part
|
||||
String bundleVersionPart = getVersion();
|
||||
String installedVersionPart = null;
|
||||
String where = "Name=?";
|
||||
String where = "Name=? AND PK_Status = 'Completed successfully'";
|
||||
Query q = new Query(Env.getCtx(), X_AD_Package_Imp.Table_Name,
|
||||
where.toString(), null);
|
||||
q.setParameters(new Object[] { getName() });
|
||||
|
@ -163,7 +163,10 @@ public class Incremental2PackActivator implements BundleActivator, ServiceTracke
|
|||
});
|
||||
|
||||
for(TwoPackEntry entry : list) {
|
||||
packIn(entry.url);
|
||||
if (!packIn(entry.url)) {
|
||||
// stop processing further packages if one fail
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,7 +178,7 @@ public class Incremental2PackActivator implements BundleActivator, ServiceTracke
|
|||
return v;
|
||||
}
|
||||
|
||||
protected void packIn(URL packout) {
|
||||
protected boolean packIn(URL packout) {
|
||||
if (packout != null && service != null) {
|
||||
String path = packout.getPath();
|
||||
String suffix = path.substring(path.lastIndexOf("_"));
|
||||
|
@ -195,6 +198,7 @@ public class Incremental2PackActivator implements BundleActivator, ServiceTracke
|
|||
service.merge(context, zipfile);
|
||||
} catch (Throwable e) {
|
||||
logger.log(Level.SEVERE, "Pack in failed.", e);
|
||||
return false;
|
||||
} finally{
|
||||
if (zipstream != null) {
|
||||
try {
|
||||
|
@ -204,6 +208,7 @@ public class Incremental2PackActivator implements BundleActivator, ServiceTracke
|
|||
}
|
||||
System.out.println(getName() + " " + packout.getPath() + " installed");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected BundleContext getContext() {
|
||||
|
|
|
@ -48,6 +48,7 @@ import org.adempiere.util.Callback;
|
|||
import org.adempiere.util.IProcessUI;
|
||||
import org.compiere.model.MPInstance;
|
||||
import org.compiere.model.MPInstancePara;
|
||||
import org.compiere.model.MProcess;
|
||||
import org.compiere.print.ReportCtl;
|
||||
import org.compiere.print.ReportEngine;
|
||||
import org.compiere.process.ProcessInfo;
|
||||
|
@ -362,14 +363,14 @@ public class ProcessDialog extends CFrame
|
|||
centerPanel.add(separator, BorderLayout.NORTH);
|
||||
centerPanel.add(parameterPanel, BorderLayout.CENTER);
|
||||
} else {
|
||||
if (m_ShowHelp != null && m_ShowHelp.equals("N")) {
|
||||
if (m_ShowHelp != null && MProcess.SHOWHELP_DonTShowHelp.equals(m_ShowHelp)) {
|
||||
bOK.doClick(); // don't ask first click
|
||||
// anyway show resulting window
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the process is a silent one
|
||||
if(m_ShowHelp != null && m_ShowHelp.equals("S"))
|
||||
if(m_ShowHelp != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_ShowHelp))
|
||||
bOK.doClick();
|
||||
|
||||
querySaved();
|
||||
|
@ -548,8 +549,8 @@ public class ProcessDialog extends CFrame
|
|||
if (m_IsReport && !pi.isError())
|
||||
bOK.doClick();
|
||||
|
||||
// If the process is a silent one and no errors occured, close the dialog
|
||||
if(m_ShowHelp != null && m_ShowHelp.equals("S"))
|
||||
// If the process is a silent one and no errors occurred, close the dialog
|
||||
if(m_ShowHelp != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_ShowHelp))
|
||||
bOK.doClick();
|
||||
} // unlockUI
|
||||
|
||||
|
@ -560,7 +561,7 @@ public class ProcessDialog extends CFrame
|
|||
public boolean isUILocked()
|
||||
{
|
||||
return m_isLocked;
|
||||
} // isLoacked
|
||||
} // isUILocked
|
||||
|
||||
/**
|
||||
* Method to be executed async.
|
||||
|
|
|
@ -33,6 +33,7 @@ import javax.swing.JSeparator;
|
|||
|
||||
import org.adempiere.exceptions.DBException;
|
||||
import org.adempiere.util.IProcessUI;
|
||||
import org.compiere.model.MProcess;
|
||||
import org.compiere.process.ProcessInfo;
|
||||
import org.compiere.swing.CButton;
|
||||
import org.compiere.swing.CDialog;
|
||||
|
@ -310,7 +311,7 @@ public class ProcessModalDialog extends CDialog
|
|||
centerPanel.add(separator, BorderLayout.NORTH);
|
||||
centerPanel.add(parameterPanel, BorderLayout.CENTER);
|
||||
} else {
|
||||
if (m_ShowHelp != null && m_ShowHelp.equals("N")) {
|
||||
if (m_ShowHelp != null && MProcess.SHOWHELP_DonTShowHelp.equals(m_ShowHelp)) {
|
||||
m_autoStart = true;
|
||||
}
|
||||
if (m_autoStart)
|
||||
|
@ -318,7 +319,7 @@ public class ProcessModalDialog extends CDialog
|
|||
}
|
||||
|
||||
// Check if the process is a silent one
|
||||
if(m_ShowHelp != null && m_ShowHelp.equals("S"))
|
||||
if(m_ShowHelp != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_ShowHelp))
|
||||
bOK.doClick();
|
||||
|
||||
dialog.revalidate();
|
||||
|
|
|
@ -555,7 +555,7 @@ public class ProcessParameter extends CDialog
|
|||
{
|
||||
MProcess m_process = new MProcess(Env.getCtx(),
|
||||
m_processInfo.getAD_Process_ID(), null);
|
||||
if(m_process.getShowHelp() != null && m_process.getShowHelp().equals("S"))
|
||||
if(m_process.getShowHelp() != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_process.getShowHelp()))
|
||||
{
|
||||
// It is defined as a silent process
|
||||
if(saveParameters())
|
||||
|
|
|
@ -223,19 +223,25 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
|
|||
|
||||
parameterPanel = new ProcessParameterPanel(m_WindowNo, m_pi);
|
||||
if ( !parameterPanel.init() ) {
|
||||
if (m_ShowHelp != null && m_ShowHelp.equals("N"))
|
||||
if (m_ShowHelp != null && MProcess.SHOWHELP_DonTShowHelp.equals(m_ShowHelp))
|
||||
autoStart = true;
|
||||
|
||||
if (autoStart)
|
||||
{
|
||||
layout();
|
||||
bOK.setDisabled(true);
|
||||
bCancel.setDisabled(true);
|
||||
autoStart();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the process is a silent one
|
||||
if (isValid() && m_ShowHelp != null && m_ShowHelp.equals("S"))
|
||||
if (isValid() && m_ShowHelp != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(m_ShowHelp))
|
||||
{
|
||||
layout();
|
||||
bOK.setDisabled(true);
|
||||
bCancel.setDisabled(true);
|
||||
autoStart();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.adempiere.webui.theme.ThemeManager;
|
|||
import org.adempiere.webui.util.ZKUpdateUtil;
|
||||
import org.adempiere.webui.window.FDialog;
|
||||
import org.adempiere.webui.window.SimplePDFViewer;
|
||||
import org.compiere.model.MProcess;
|
||||
import org.compiere.model.X_AD_CtxHelp;
|
||||
import org.compiere.print.ReportEngine;
|
||||
import org.compiere.process.ProcessInfo;
|
||||
|
@ -271,6 +272,7 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
|
|||
}
|
||||
|
||||
private void showBusyMask(Window window) {
|
||||
if (getParent() != null) {
|
||||
getParent().appendChild(getMask());
|
||||
StringBuilder script = new StringBuilder("var w=zk.Widget.$('#");
|
||||
script.append(getParent().getUuid()).append("');");
|
||||
|
@ -280,6 +282,7 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
|
|||
script.append("w.busy=true;");
|
||||
}
|
||||
Clients.response(new AuScript(script.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
private void hideBusyMask()
|
||||
|
@ -323,10 +326,12 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
|
|||
|
||||
bOK.setLabel(Msg.getMsg(Env.getCtx(), "Parameter"));
|
||||
bOK.setImage(ThemeManager.getThemeResource("images/Reset16.png"));
|
||||
|
||||
bOK.setDisabled(false);
|
||||
|
||||
bCancel.setLabel(Msg.getMsg(Env.getCtx(), "Close"));
|
||||
bCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
|
||||
|
||||
bCancel.setDisabled(false);
|
||||
|
||||
isParameterPage = false;
|
||||
|
||||
m_ids = pi.getIDs();
|
||||
|
@ -459,8 +464,8 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
|
|||
{
|
||||
//
|
||||
if (!afterProcessTask()) {
|
||||
// If the process is a silent one and no errors occured, close the dialog
|
||||
if(getShowHelp() != null && getShowHelp().equals("S"))
|
||||
// If the process is a silent one and no errors occurred, close the dialog
|
||||
if(getShowHelp() != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(getShowHelp()))
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
|
@ -571,8 +576,8 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
|
|||
}
|
||||
}
|
||||
|
||||
// If the process is a silent one and no errors occured, close the dialog
|
||||
if(getShowHelp() != null && getShowHelp().equals("S"))
|
||||
// If the process is a silent one and no errors occurred, close the dialog
|
||||
if(getShowHelp() != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(getShowHelp()))
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
|
@ -654,8 +659,8 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
|
|||
}
|
||||
}
|
||||
|
||||
// If the process is a silent one and no errors occured, close the dialog
|
||||
if(getShowHelp() != null && getShowHelp().equals("S"))
|
||||
// If the process is a silent one and no errors occurred, close the dialog
|
||||
if(getShowHelp() != null && MProcess.SHOWHELP_RunSilently_TakeDefaults.equals(getShowHelp()))
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -315,6 +315,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
// contentPanel.setSizedByContent(true);
|
||||
contentPanel.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "infoListbox");
|
||||
contentPanel.addEventListener("onAfterRender", this);
|
||||
contentPanel.setSclass("z-word-nowrap");
|
||||
|
||||
this.setSclass("info-panel");
|
||||
} // init
|
||||
|
|
|
@ -151,36 +151,40 @@ public class LoginPanel extends Window implements EventListener<Event>
|
|||
try
|
||||
{
|
||||
int AD_Session_ID = Integer.parseInt(data[0]);
|
||||
MSession session = new MSession(Env.getCtx(), AD_Session_ID, null);
|
||||
if (session.get_ID() == AD_Session_ID)
|
||||
int cnt = DB.getSQLValueEx(null, "SELECT COUNT(*) FROM AD_Session WHERE AD_Session_ID=?", AD_Session_ID);
|
||||
if (cnt == 1)
|
||||
{
|
||||
int AD_User_ID = session.getCreatedBy();
|
||||
MUser user = MUser.get(Env.getCtx(), AD_User_ID);
|
||||
if (user != null && user.get_ID() == AD_User_ID)
|
||||
MSession session = new MSession(Env.getCtx(), AD_Session_ID, null);
|
||||
if (session.get_ID() == AD_Session_ID)
|
||||
{
|
||||
String token = data[1];
|
||||
if (BrowserToken.validateToken(session, user, token))
|
||||
{
|
||||
if (MSystem.isZKRememberUserAllowed()) {
|
||||
if (email_login) {
|
||||
txtUserId.setValue(user.getEMail());
|
||||
} else {
|
||||
if (user.getLDAPUser() != null && user.getLDAPUser().length() > 0) {
|
||||
txtUserId.setValue(user.getLDAPUser());
|
||||
} else {
|
||||
txtUserId.setValue(user.getName());
|
||||
}
|
||||
}
|
||||
onUserIdChange(AD_User_ID);
|
||||
chkRememberMe.setChecked(true);
|
||||
}
|
||||
if (MSystem.isZKRememberPasswordAllowed()) {
|
||||
txtPassword.setValue(token);
|
||||
txtPassword.setAttribute("user.token.hash", token);
|
||||
txtPassword.setAttribute("user.token.sid", AD_Session_ID);
|
||||
}
|
||||
chkSelectRole.setChecked(false);
|
||||
}
|
||||
int AD_User_ID = session.getCreatedBy();
|
||||
MUser user = MUser.get(Env.getCtx(), AD_User_ID);
|
||||
if (user != null && user.get_ID() == AD_User_ID)
|
||||
{
|
||||
String token = data[1];
|
||||
if (BrowserToken.validateToken(session, user, token))
|
||||
{
|
||||
if (MSystem.isZKRememberUserAllowed()) {
|
||||
if (email_login) {
|
||||
txtUserId.setValue(user.getEMail());
|
||||
} else {
|
||||
if (user.getLDAPUser() != null && user.getLDAPUser().length() > 0) {
|
||||
txtUserId.setValue(user.getLDAPUser());
|
||||
} else {
|
||||
txtUserId.setValue(user.getName());
|
||||
}
|
||||
}
|
||||
onUserIdChange(AD_User_ID);
|
||||
chkRememberMe.setChecked(true);
|
||||
}
|
||||
if (MSystem.isZKRememberPasswordAllowed()) {
|
||||
txtPassword.setValue(token);
|
||||
txtPassword.setAttribute("user.token.hash", token);
|
||||
txtPassword.setAttribute("user.token.sid", AD_Session_ID);
|
||||
}
|
||||
chkSelectRole.setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -568,7 +572,7 @@ public class LoginPanel extends Window implements EventListener<Event>
|
|||
// IDEMPIERE-617
|
||||
String x_Forward_IP = Executions.getCurrent().getHeader("X-Forwarded-For");
|
||||
if (x_Forward_IP == null) {
|
||||
x_Forward_IP = currSess.getRemoteAddr();
|
||||
x_Forward_IP = Executions.getCurrent().getRemoteAddr();
|
||||
}
|
||||
logAuthFailure.log(x_Forward_IP, "/webui", userId, loginErrMsg);
|
||||
|
||||
|
|
|
@ -45,6 +45,13 @@ div.z-column-cnt, div.z-grid-header div.z-auxheader-cnt {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.z-listcell > div.z-listcell-content {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.z-column-content, .z-listheader-content, .z-listcell-content {
|
||||
padding: 2px 3px 1px;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue