diff --git a/db/ddlutils/oracle/views/AD_FIELD_V.sql b/db/ddlutils/oracle/views/AD_FIELD_V.sql
index d91cefc714..7fecce15af 100644
--- a/db/ddlutils/oracle/views/AD_FIELD_V.sql
+++ b/db/ddlutils/oracle/views/AD_FIELD_V.sql
@@ -3,7 +3,7 @@ CREATE OR REPLACE VIEW AD_FIELD_V AS
f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
- c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
+ c.ColumnName, c.ColumnSQL, c.FieldLength, COALESCE(f.VFormat, c.VFormat) AS VFormat,
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
diff --git a/db/ddlutils/oracle/views/AD_FIELD_VT.sql b/db/ddlutils/oracle/views/AD_FIELD_VT.sql
index 2dd8cf90d6..2c097744bc 100644
--- a/db/ddlutils/oracle/views/AD_FIELD_VT.sql
+++ b/db/ddlutils/oracle/views/AD_FIELD_VT.sql
@@ -3,7 +3,7 @@ CREATE OR REPLACE VIEW AD_FIELD_VT AS
trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
- c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
+ c.ColumnName, c.ColumnSQL, c.FieldLength, COALESCE(f.VFormat, c.VFormat) AS VFormat,
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
diff --git a/db/ddlutils/postgresql/views/AD_FIELD_V.sql b/db/ddlutils/postgresql/views/AD_FIELD_V.sql
index 0bea1acc23..e00ed02966 100644
--- a/db/ddlutils/postgresql/views/AD_FIELD_V.sql
+++ b/db/ddlutils/postgresql/views/AD_FIELD_V.sql
@@ -2,7 +2,7 @@ CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description,
f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading,
f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql,
- c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent,
+ c.fieldlength, COALESCE(f.vformat, c.vformat) AS vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent,
COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout,
COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
diff --git a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql
index 294da51db3..7e03965532 100644
--- a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql
+++ b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql
@@ -2,7 +2,7 @@ CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id,
trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno,
f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype,
-c.columnname, c.columnsql, c.fieldlength, c.vformat,
+c.columnname, c.columnsql, c.fieldlength, COALESCE(f.vformat, c.vformat) AS vformat,
COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent,
COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout,
diff --git a/migration/i3.1/oracle/201603031539_IDEMPIERE-3046.sql b/migration/i3.1/oracle/201603031539_IDEMPIERE-3046.sql
new file mode 100644
index 0000000000..c6d27ae1ba
--- /dev/null
+++ b/migration/i3.1/oracle/201603031539_IDEMPIERE-3046.sql
@@ -0,0 +1,164 @@
+SET SQLBLANKLINES ON
+SET DEFINE OFF
+
+-- IDEMPIERE-3046 Add Currency Field to Cost Adjustment Window
+-- Mar 3, 2016 3:11:22 PM SGT
+INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Description,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200091,'C_Currency in accounting schema','Available currencies are based on the schemas currency.','S','C_Currency_ID in (SELECT C_Currency_ID FROM C_AcctSchema Where AD_Client_ID = @AD_Client_ID@)',0,0,'Y',TO_DATE('2016-03-03 15:11:21','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-03-03 15:11:21','YYYY-MM-DD HH24:MI:SS'),100,'D','b632eb71-14ab-498f-b956-58f549082dea')
+;
+
+-- Mar 3, 2016 3:12:38 PM SGT
+INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,AD_Val_Rule_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType) VALUES (212647,0,'Currency','The Currency for this record','Indicates the Currency to be used when processing or reporting on this record',321,200091,'C_Currency_ID',22,'N','N','N','N','N',0,'N',19,0,0,'Y',TO_DATE('2016-03-03 15:12:37','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-03-03 15:12:37','YYYY-MM-DD HH24:MI:SS'),100,193,'Y','N','D','N','N','N','Y','a10d0295-362d-42c5-a84e-5c33ae7f0fb7','Y',0,'N','N','N')
+;
+
+-- Mar 3, 2016 3:13:00 PM SGT
+INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType) VALUES (212648,0,'Currency Type','Currency Conversion Rate Type','The Currency Conversion Rate Type lets you define different type of rates, e.g. Spot, Corporate and/or Sell/Buy rates.',321,'C_ConversionType_ID',22,'N','N','N','N','N',0,'N',19,0,0,'Y',TO_DATE('2016-03-03 15:12:59','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-03-03 15:12:59','YYYY-MM-DD HH24:MI:SS'),100,2278,'Y','N','D','N','N','N','Y','94ead663-3677-4bd0-ae50-152acbb36471','Y',0,'N','N','N')
+;
+
+-- Mar 3, 2016 3:13:05 PM SGT
+UPDATE AD_Column SET FKConstraintName='CConversionType_MInventory', FKConstraintType='N',Updated=TO_DATE('2016-03-03 15:13:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212648
+;
+
+-- Mar 3, 2016 3:13:05 PM SGT
+ALTER TABLE M_Inventory ADD C_ConversionType_ID NUMBER(10) DEFAULT NULL
+;
+
+-- Mar 3, 2016 3:13:05 PM SGT
+ALTER TABLE M_Inventory ADD CONSTRAINT CConversionType_MInventory FOREIGN KEY (C_ConversionType_ID) REFERENCES c_conversiontype(c_conversiontype_id) DEFERRABLE INITIALLY DEFERRED
+;
+
+-- Mar 3, 2016 3:13:24 PM SGT
+UPDATE AD_Column SET FKConstraintName='CCurrency_MInventory', FKConstraintType='N',Updated=TO_DATE('2016-03-03 15:13:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212647
+;
+
+-- Mar 3, 2016 3:13:24 PM SGT
+ALTER TABLE M_Inventory ADD C_Currency_ID NUMBER(10) DEFAULT NULL
+;
+
+-- Mar 3, 2016 3:13:24 PM SGT
+ALTER TABLE M_Inventory ADD CONSTRAINT CCurrency_MInventory FOREIGN KEY (C_Currency_ID) REFERENCES c_currency(c_currency_id) DEFERRABLE INITIALLY DEFERRED
+;
+
+-- Mar 3, 2016 3:14:33 PM SGT
+INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (204145,'Currency','The Currency for this record','Indicates the Currency to be used when processing or reporting on this record',200102,212647,'Y',0,170,0,'N','N','N','N',0,0,'Y',TO_DATE('2016-03-03 15:14:32','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-03-03 15:14:32','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','4db70d18-3eec-45a6-a023-b2e15ac2a075','Y',200,1,1,1,'N','N','N')
+;
+
+-- Mar 3, 2016 3:14:49 PM SGT
+INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (204146,'Currency Type','Currency Conversion Rate Type','The Currency Conversion Rate Type lets you define different type of rates, e.g. Spot, Corporate and/or Sell/Buy rates.',200102,212648,'Y',0,180,0,'N','N','N','N',0,0,'Y',TO_DATE('2016-03-03 15:14:48','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-03-03 15:14:48','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','2bac096b-6a89-4643-8594-4cbbbd56b829','Y',210,1,1,1,'N','N','N')
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=204145
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=204146
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=202316
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=202303
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=202305
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=202306
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=202307
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=202308
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=202309
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=202310
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=202313
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=202314
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=202315
+;
+
+update m_inventory
+set c_currency_id = (select a.c_currency_id from c_acctschema a,
+ ad_clientinfo ci where ci.c_acctschema1_id = a.c_acctschema_id
+ and ci.ad_client_id = m_inventory.ad_client_id)
+where c_doctype_id in (select c_doctype_id from c_doctype where ad_client_id = m_inventory.ad_client_id
+ and docsubtypeinv ='CA' and docbasetype='MMI' and isactive='Y')
+;
+
+
+
+-- IDEMPIERE-3046 Add Currency Field to Cost Adjustment Window
+-- Mar 3, 2016 3:32:39 PM SGT
+UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2016-03-03 15:32:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212647
+;
+
+-- Mar 3, 2016 3:32:54 PM SGT
+UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2016-03-03 15:32:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212648
+;
+
+-- Mar 3, 2016 3:34:51 PM SGT
+UPDATE AD_Field SET DisplayLogic='@C_Currency_ID@!@$C_Currency_ID@',Updated=TO_DATE('2016-03-03 15:34:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204146
+;
+
+-- Mar 21, 2016 7:12:45 PM SGT
+UPDATE AD_Val_Rule SET Code='C_Currency_ID in (SELECT C_Currency_ID FROM C_AcctSchema Where AD_Client_ID = @AD_Client_ID@ AND (IsMemberOfAcctSchema(AD_Client_ID,@AD_Org_ID@,C_AcctSchema_ID) OR AD_OrgOnly_ID Is NULL ))',Updated=TO_DATE('2016-03-15 01:12:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200091
+;
+
+CREATE or REPLACE FUNCTION IsMemberOfAcctSchema( p_AD_Client_ID NUMBER , p_AD_Org_ID NUMBER , p_C_AcctSchema_ID NUMBER )
+RETURN boolean AS
+ v_ad_org_id NUMBER ;
+ v_count NUMBER ;
+BEGIN
+v_ad_org_id := -1;
+v_count :=0 ;
+SELECT count(*) into v_count from C_AcctSchema c
+Where C_AcctSchema_ID <> p_C_AcctSchema_ID
+and AD_OrgOnly_ID= p_AD_Org_ID;
+
+
+if (v_count = 0 ) Then
+ WITH tr(level, parent_name, name, ad_org_id) as (
+ select 0, null as parentName, ad_org.name, tn.node_id
+ from ad_tree t
+ join ad_treenode tn on t.ad_tree_id=tn.ad_tree_id
+ join ad_org on tn.node_id=ad_org.ad_org_id
+ join c_acctschema ca on ad_org.ad_org_id=ca.AD_OrgOnly_ID and ca.C_AcctSchema_ID=p_C_AcctSchema_ID
+ where t.treetype='OO' AND t.ad_client_id= p_AD_Client_ID
+ and ((tn.parent_id = 0 and ad_org.issummary='Y') or (ad_org.ad_org_id=p_AD_Org_ID))
+ UNION ALL select level+1, tr.name, ad_org.name, tn.node_id
+ from ad_tree t
+ join ad_treenode tn on t.ad_tree_id=tn.ad_tree_id
+ join ad_org on tn.node_id=ad_org.ad_org_id
+ join tr on tr.ad_org_id=tn.parent_id
+ where tn.node_id=p_AD_Org_ID)
+ select ad_org_id into v_ad_org_id from tr where ad_org_id=p_ad_org_id;
+END IF;
+
+ return v_ad_org_id=p_ad_org_id;
+END;
+/
+
+SELECT register_migration_script('201603031539_IDEMPIERE-3046.sql') FROM dual
+;
+
diff --git a/migration/i3.1/oracle/201605051202_IDEMPIERE-3090.sql b/migration/i3.1/oracle/201605051202_IDEMPIERE-3090.sql
new file mode 100644
index 0000000000..bc828fab8d
--- /dev/null
+++ b/migration/i3.1/oracle/201605051202_IDEMPIERE-3090.sql
@@ -0,0 +1,15 @@
+SET SQLBLANKLINES ON
+SET DEFINE OFF
+
+-- IDEMPIERE-3090 Inventory Count Search Key is too short
+-- May 5, 2016 11:47:46 AM PDT
+UPDATE AD_Process_Para SET FieldLength=40,Updated=TO_DATE('2016-05-05 11:47:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=158
+;
+
+-- May 5, 2016 11:48:34 AM PDT
+UPDATE AD_Process_Para SET FieldLength=40,Updated=TO_DATE('2016-05-05 11:48:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=123
+;
+
+SELECT register_migration_script('201605051202_IDEMPIERE-3090.sql') FROM dual
+;
+
diff --git a/migration/i3.1/oracle/201605052331_IDEMPIERE-2020.sql b/migration/i3.1/oracle/201605052331_IDEMPIERE-2020.sql
new file mode 100644
index 0000000000..0d0dbb6ac5
--- /dev/null
+++ b/migration/i3.1/oracle/201605052331_IDEMPIERE-2020.sql
@@ -0,0 +1,266 @@
+SET SQLBLANKLINES ON
+SET DEFINE OFF
+
+-- IDEMPIERE-2020 Value Format for ZK
+-- Feb 25, 2015 5:45:01 PM COT
+UPDATE AD_Column SET ReadOnlyLogic=NULL,Updated=TO_DATE('2015-02-25 17:45:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1179
+;
+
+-- Feb 25, 2015 5:54:41 PM COT
+INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (211839,0,'Value Format','Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"','Validation elements:
+ (Space) any character
+_ Space (fixed character)
+l any Letter a..Z NO space
+L any Letter a..Z NO space converted to upper case
+o any Letter a..Z or space
+O any Letter a..Z or space converted to upper case
+a any Letters & Digits NO space
+A any Letters & Digits NO space converted to upper case
+c any Letters & Digits or space
+C any Letters & Digits or space converted to upper case
+0 Digits 0..9 NO space
+9 Digits 0..9 or space
+
+Example of format "(000)_000-0000"',107,'VFormat',255,'N','N','N','N','N',0,'N',10,0,0,'Y',TO_DATE('2015-02-25 17:54:41','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-02-25 17:54:41','YYYY-MM-DD HH24:MI:SS'),100,616,'Y','N','D','N','N','N','Y','a585debb-2c2f-4a8f-89c9-28281fd44b62','Y',0,'N','N')
+;
+
+-- Feb 25, 2015 5:55:50 PM COT
+UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2015-02-25 17:55:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1179
+;
+
+-- Feb 25, 2015 5:55:52 PM COT
+ALTER TABLE AD_Column MODIFY VFormat NVARCHAR2(255) DEFAULT NULL
+;
+
+-- Feb 25, 2015 5:56:14 PM COT
+UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2015-02-25 17:56:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3740
+;
+
+-- Feb 25, 2015 5:56:15 PM COT
+ALTER TABLE AD_Process_Para MODIFY VFormat NVARCHAR2(255) DEFAULT NULL
+;
+
+-- Feb 25, 2015 5:57:01 PM COT
+INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (211840,0,'Value Format','Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"','Validation elements:
+ (Space) any character
+_ Space (fixed character)
+l any Letter a..Z NO space
+L any Letter a..Z NO space converted to upper case
+o any Letter a..Z or space
+O any Letter a..Z or space converted to upper case
+a any Letters & Digits NO space
+A any Letters & Digits NO space converted to upper case
+c any Letters & Digits or space
+C any Letters & Digits or space converted to upper case
+0 Digits 0..9 NO space
+9 Digits 0..9 or space
+
+Example of format "(000)_000-0000"',464,'VFormat',255,'N','N','N','N','N',0,'N',10,0,0,'Y',TO_DATE('2015-02-25 17:57:00','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-02-25 17:57:00','YYYY-MM-DD HH24:MI:SS'),100,616,'Y','N','U','N','N','N','Y','35514060-1c96-435d-b3bf-101ed064d4f6','Y',0,'N','N')
+;
+
+-- Feb 25, 2015 5:57:03 PM COT
+ALTER TABLE AD_UserDef_Field ADD VFormat NVARCHAR2(255) DEFAULT NULL
+;
+
+-- Feb 25, 2015 5:57:30 PM COT
+INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (203499,'Value Format','Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"','Validation elements:
+ (Space) any character
+_ Space (fixed character)
+l any Letter a..Z NO space
+L any Letter a..Z NO space converted to upper case
+o any Letter a..Z or space
+O any Letter a..Z or space converted to upper case
+a any Letters & Digits NO space
+A any Letters & Digits NO space converted to upper case
+c any Letters & Digits or space
+C any Letters & Digits or space converted to upper case
+0 Digits 0..9 NO space
+9 Digits 0..9 or space
+
+Example of format "(000)_000-0000"',395,211840,'Y',255,290,'N','N','N','N',0,0,'Y',TO_DATE('2015-02-25 17:57:30','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-02-25 17:57:30','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','U','f8a92fba-ee26-4ccc-95ed-62dcfd3d7207','Y',290,5)
+;
+
+-- Feb 25, 2015 6:00:15 PM COT
+ALTER TABLE AD_Field ADD VFormat NVARCHAR2(255) DEFAULT NULL
+;
+
+-- Feb 25, 2015 6:04:12 PM COT
+UPDATE AD_Field SET IsDisplayed='Y', SeqNo=270, XPosition=1,Updated=TO_DATE('2015-02-25 18:04:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203499
+;
+
+-- Feb 25, 2015 6:04:12 PM COT
+UPDATE AD_Field SET SeqNo=280,Updated=TO_DATE('2015-02-25 18:04:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5051
+;
+
+-- Feb 25, 2015 6:04:12 PM COT
+UPDATE AD_Field SET SeqNo=290,Updated=TO_DATE('2015-02-25 18:04:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5057
+;
+
+-- Feb 25, 2015 6:04:41 PM COT
+INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (203500,'Value Format','Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"','Validation elements:
+ (Space) any character
+_ Space (fixed character)
+l any Letter a..Z NO space
+L any Letter a..Z NO space converted to upper case
+o any Letter a..Z or space
+O any Letter a..Z or space converted to upper case
+a any Letters & Digits NO space
+A any Letters & Digits NO space converted to upper case
+c any Letters & Digits or space
+C any Letters & Digits or space converted to upper case
+0 Digits 0..9 NO space
+9 Digits 0..9 or space
+
+Example of format "(000)_000-0000"',107,211839,'Y',255,410,'N','N','N','N',0,0,'Y',TO_DATE('2015-02-25 18:04:41','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-02-25 18:04:41','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','8eb1b299-24e3-4c1b-bbc6-5c3b92e1adf8','Y',400,5)
+;
+
+-- Feb 25, 2015 6:05:15 PM COT
+UPDATE AD_Field SET SeqNo=250,Updated=TO_DATE('2015-02-25 18:05:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=141
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=260,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200350
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=270,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200348
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=280,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200349
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=290,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13425
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=300,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200837
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=310,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54402
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=320,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54401
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=330,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200838
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=340,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200834
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=350,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13424
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=360,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62468
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=370,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53280
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=380,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200836
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=390,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200835
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET IsDisplayed='Y', SeqNo=400, XPosition=1,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203500
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=410,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=136
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=420,Updated=TO_DATE('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=139
+;
+
+CREATE OR REPLACE VIEW AD_FIELD_V AS
+ SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
+ f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
+ f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
+ f.IsEncrypted AS IsEncryptedField, f.ObscureType,
+ c.ColumnName, c.ColumnSQL, c.FieldLength, COALESCE(f.VFormat, c.VFormat) AS VFormat,
+ COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
+ c.IsKey, c.IsParent,
+ COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
+ c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
+ c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
+ COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) AS AD_Val_Rule_ID, c.AD_Process_ID,
+ COALESCE(f.Isalwaysupdateable , C.Isalwaysupdateable) As Isalwaysupdateable,
+ COALESCE(f.Readonlylogic, c.Readonlylogic ) As Readonlylogic,
+ COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic,
+ COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.IsEncrypted AS IsEncryptedColumn,
+ c.IsSelectionColumn,
+ tbl.TableName, c.ValueMin, c.ValueMax,
+ fg.NAME AS FieldGroup, vr.Code AS ValidationCode,
+ f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
+ COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
+ c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
+ f.isdisplayedgrid,
+ f.seqnogrid,
+ c.seqnoselection, f.xposition, f.columnspan, f.numlines,
+ COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
+ c.FormatPattern, f.isadvancedfield, f.IsDefaultFocus, c.AD_Chart_ID
+FROM AD_FIELD f
+ INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
+ LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
+ LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
+ INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
+ LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
+WHERE f.IsActive = 'Y'
+ AND c.IsActive = 'Y'
+;
+
+CREATE OR REPLACE VIEW AD_FIELD_VT AS
+ SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
+ trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
+ f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
+ f.IsEncrypted AS IsEncryptedField, f.ObscureType,
+ c.ColumnName, c.ColumnSQL, c.FieldLength, COALESCE(f.VFormat, c.VFormat) AS VFormat,
+ COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
+ c.IsKey, c.IsParent,
+ COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
+ c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
+ c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
+ COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) as AD_Val_Rule_ID, c.AD_Process_ID,
+ COALESCE(f.Isalwaysupdateable , C.Isalwaysupdateable) As Isalwaysupdateable,
+ COALESCE(f.Readonlylogic, c.Readonlylogic ) As Readonlylogic,
+ COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic,
+ COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
+ tbl.TableName, c.ValueMin, c.ValueMax,
+ fgt.NAME AS FieldGroup, vr.Code AS ValidationCode,
+ f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
+ COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
+ c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
+ f.isdisplayedgrid,
+ f.seqnogrid,
+ c.seqnoselection, f.xposition, f.columnspan, f.numlines,
+ COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton,
+ c.FormatPattern, f.isadvancedfield, f.IsDefaultFocus, c.AD_Chart_ID
+ FROM AD_FIELD f
+ INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
+ INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
+ LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
+ LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON
+ (f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE)
+ LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
+ INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
+ LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
+ WHERE f.IsActive = 'Y'
+ AND c.IsActive = 'Y'
+;
+
+SELECT register_migration_script('201605052331_IDEMPIERE-2020.sql') FROM dual
+;
diff --git a/migration/i3.1/oracle/201605082126_IDEMPIERE-3065.sql b/migration/i3.1/oracle/201605082126_IDEMPIERE-3065.sql
new file mode 100644
index 0000000000..7431565d3f
--- /dev/null
+++ b/migration/i3.1/oracle/201605082126_IDEMPIERE-3065.sql
@@ -0,0 +1,8 @@
+-- IDEMPIERE-3065 Sales Pipeline Chart hardcode
+-- Apr 1, 2016 8:11:34 PM ICT
+UPDATE AD_ChartDatasource SET Description=NULL, WhereClause='o.IsActive=''Y'' AND s.IsClosed=''N ''and o.SalesRep_ID=@#AD_User_ID@',Updated=TO_DATE('2016-04-01 20:11:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ChartDatasource_ID=50000
+;
+
+SELECT register_migration_script('201605082126_IDEMPIERE-3065.sql') FROM dual
+;
+
diff --git a/migration/i3.1/oracle/201605091119_IDEMPIERE-3093.sql b/migration/i3.1/oracle/201605091119_IDEMPIERE-3093.sql
new file mode 100644
index 0000000000..67f43257e2
--- /dev/null
+++ b/migration/i3.1/oracle/201605091119_IDEMPIERE-3093.sql
@@ -0,0 +1,14 @@
+SET SQLBLANKLINES ON
+SET DEFINE OFF
+
+-- IDEMPIERE-3093 Product fields not showing identifiers in some windows
+-- May 9, 2016 11:18:56 AM PDT
+UPDATE AD_Ref_Table SET IsValueDisplayed='Y',Updated=TO_DATE('2016-05-09 11:18:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID IN (161,
+162,
+171,
+211)
+;
+
+SELECT register_migration_script('201605091119_IDEMPIERE-3093.sql') FROM dual
+;
+
diff --git a/migration/i3.1/postgresql/201603031539_IDEMPIERE-3046.sql b/migration/i3.1/postgresql/201603031539_IDEMPIERE-3046.sql
new file mode 100644
index 0000000000..8fd561db3d
--- /dev/null
+++ b/migration/i3.1/postgresql/201603031539_IDEMPIERE-3046.sql
@@ -0,0 +1,167 @@
+-- IDEMPIERE-3046 Add Currency Field to Cost Adjustment Window
+-- Mar 3, 2016 3:10:37 PM SGT
+
+-- Mar 3, 2016 3:11:22 PM SGT
+INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Description,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200091,'C_Currency in accounting schema','Available currencies are based on the schemas currency.','S','C_Currency_ID in (SELECT C_Currency_ID FROM C_AcctSchema Where AD_Client_ID = @AD_Client_ID@)',0,0,'Y',TO_TIMESTAMP('2016-03-03 15:11:21','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-03-03 15:11:21','YYYY-MM-DD HH24:MI:SS'),100,'D','b632eb71-14ab-498f-b956-58f549082dea')
+;
+
+-- Mar 3, 2016 3:12:38 PM SGT
+INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,AD_Val_Rule_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType) VALUES (212647,0,'Currency','The Currency for this record','Indicates the Currency to be used when processing or reporting on this record',321,200091,'C_Currency_ID',22,'N','N','N','N','N',0,'N',19,0,0,'Y',TO_TIMESTAMP('2016-03-03 15:12:37','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-03-03 15:12:37','YYYY-MM-DD HH24:MI:SS'),100,193,'Y','N','D','N','N','N','Y','a10d0295-362d-42c5-a84e-5c33ae7f0fb7','Y',0,'N','N','N')
+;
+
+-- Mar 3, 2016 3:13:00 PM SGT
+INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType) VALUES (212648,0,'Currency Type','Currency Conversion Rate Type','The Currency Conversion Rate Type lets you define different type of rates, e.g. Spot, Corporate and/or Sell/Buy rates.',321,'C_ConversionType_ID',22,'N','N','N','N','N',0,'N',19,0,0,'Y',TO_TIMESTAMP('2016-03-03 15:12:59','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-03-03 15:12:59','YYYY-MM-DD HH24:MI:SS'),100,2278,'Y','N','D','N','N','N','Y','94ead663-3677-4bd0-ae50-152acbb36471','Y',0,'N','N','N')
+;
+
+-- Mar 3, 2016 3:13:05 PM SGT
+UPDATE AD_Column SET FKConstraintName='CConversionType_MInventory', FKConstraintType='N',Updated=TO_TIMESTAMP('2016-03-03 15:13:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212648
+;
+
+-- Mar 3, 2016 3:13:05 PM SGT
+ALTER TABLE M_Inventory ADD COLUMN C_ConversionType_ID NUMERIC(10) DEFAULT NULL
+;
+
+-- Mar 3, 2016 3:13:05 PM SGT
+ALTER TABLE M_Inventory ADD CONSTRAINT CConversionType_MInventory FOREIGN KEY (C_ConversionType_ID) REFERENCES c_conversiontype(c_conversiontype_id) DEFERRABLE INITIALLY DEFERRED
+;
+
+-- Mar 3, 2016 3:13:24 PM SGT
+UPDATE AD_Column SET FKConstraintName='CCurrency_MInventory', FKConstraintType='N',Updated=TO_TIMESTAMP('2016-03-03 15:13:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212647
+;
+
+-- Mar 3, 2016 3:13:24 PM SGT
+ALTER TABLE M_Inventory ADD COLUMN C_Currency_ID NUMERIC(10) DEFAULT NULL
+;
+
+-- Mar 3, 2016 3:13:24 PM SGT
+ALTER TABLE M_Inventory ADD CONSTRAINT CCurrency_MInventory FOREIGN KEY (C_Currency_ID) REFERENCES c_currency(c_currency_id) DEFERRABLE INITIALLY DEFERRED
+;
+
+-- Mar 3, 2016 3:14:33 PM SGT
+INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (204145,'Currency','The Currency for this record','Indicates the Currency to be used when processing or reporting on this record',200102,212647,'Y',0,170,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-03-03 15:14:32','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-03-03 15:14:32','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','4db70d18-3eec-45a6-a023-b2e15ac2a075','Y',200,1,1,1,'N','N','N')
+;
+
+-- Mar 3, 2016 3:14:49 PM SGT
+INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (204146,'Currency Type','Currency Conversion Rate Type','The Currency Conversion Rate Type lets you define different type of rates, e.g. Spot, Corporate and/or Sell/Buy rates.',200102,212648,'Y',0,180,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2016-03-03 15:14:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-03-03 15:14:48','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','2bac096b-6a89-4643-8594-4cbbbd56b829','Y',210,1,1,1,'N','N','N')
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=204145
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=204146
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=202316
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=202303
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=202305
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=202306
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=202307
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=202308
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=202309
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=202310
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=202313
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=202314
+;
+
+-- Mar 3, 2016 3:15:23 PM SGT
+UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=202315
+;
+
+update m_inventory
+set c_currency_id = (select a.c_currency_id from c_acctschema a
+ inner join ad_clientinfo ci on ci.c_acctschema1_id = a.c_acctschema_id
+ and ci.ad_client_id = m_inventory.ad_client_id)
+where c_doctype_id in (select c_doctype_id from c_doctype where ad_client_id = m_inventory.ad_client_id
+ and docsubtypeinv ='CA' and docbasetype='MMI' and isactive='Y')
+;
+
+
+-- IDEMPIERE-3046 Add Currency Field to Cost Adjustment Window
+
+-- Mar 3, 2016 3:32:39 PM SGT
+UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2016-03-03 15:32:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212647
+;
+
+-- Mar 3, 2016 3:32:54 PM SGT
+UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2016-03-03 15:32:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=212648
+;
+
+-- Mar 3, 2016 3:34:51 PM SGT
+UPDATE AD_Field SET DisplayLogic='@C_Currency_ID@!@$C_Currency_ID@',Updated=TO_TIMESTAMP('2016-03-03 15:34:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204146
+;
+
+-- Mar 21, 2016 7:12:45 PM SGT
+UPDATE AD_Val_Rule SET Code='C_Currency_ID in (SELECT C_Currency_ID FROM C_AcctSchema Where AD_Client_ID = @AD_Client_ID@ AND (IsMemberOfAcctSchema(AD_Client_ID,@AD_Org_ID@,C_AcctSchema_ID) OR AD_OrgOnly_ID Is NULL ))',Updated=TO_TIMESTAMP('2016-03-15 01:12:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200091
+;
+
+CREATE or REPLACE FUNCTION IsMemberOfAcctSchema( p_AD_Client_ID numeric, p_AD_Org_ID numeric, p_C_AcctSchema_ID numeric)
+RETURNS boolean AS
+$BODY$
+DECLARE
+ v_ad_org_id numeric;
+ v_count numeric;
+BEGIN
+v_ad_org_id = -1;
+v_count = 0;
+
+SELECT count(*) into v_count from C_AcctSchema c
+Where C_AcctSchema_ID <> p_C_AcctSchema_ID
+and AD_OrgOnly_ID= p_AD_Org_ID;
+
+
+if (v_count = 0 ) Then
+ WITH RECURSIVE tr( ad_org_id) as (
+ select tn.node_id
+ from ad_tree t
+ join ad_treenode tn on t.ad_tree_id=tn.ad_tree_id
+ join ad_org on tn.node_id=ad_org.ad_org_id
+ join c_acctschema ca on ad_org.ad_org_id=ca.AD_OrgOnly_ID and ca.C_AcctSchema_ID=p_C_AcctSchema_ID
+ where t.treetype='OO' AND t.ad_client_id= p_AD_Client_ID
+ and ((tn.parent_id = 0 and ad_org.issummary='Y') or (ad_org.ad_org_id=p_AD_Org_ID))
+ UNION select tn.node_id
+ from ad_tree t
+ join ad_treenode tn on t.ad_tree_id=tn.ad_tree_id
+ join ad_org on tn.node_id=ad_org.ad_org_id
+ join tr on tr.ad_org_id=tn.parent_id
+ where tn.node_id=p_AD_Org_ID)
+ select ad_org_id into v_ad_org_id from tr where ad_org_id=p_ad_org_id;
+End If;
+ return v_ad_org_id=p_ad_org_id;
+END;
+$BODY$
+LANGUAGE plpgsql VOLATILE;
+
+
+SELECT register_migration_script('201603031539_IDEMPIERE-3046.sql') FROM dual
+;
+
diff --git a/migration/i3.1/postgresql/201605051202_IDEMPIERE-3090.sql b/migration/i3.1/postgresql/201605051202_IDEMPIERE-3090.sql
new file mode 100644
index 0000000000..c60bcce31b
--- /dev/null
+++ b/migration/i3.1/postgresql/201605051202_IDEMPIERE-3090.sql
@@ -0,0 +1,12 @@
+-- IDEMPIERE-3090 Inventory Count Search Key is too short
+-- May 5, 2016 11:47:46 AM PDT
+UPDATE AD_Process_Para SET FieldLength=40,Updated=TO_TIMESTAMP('2016-05-05 11:47:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=158
+;
+
+-- May 5, 2016 11:48:34 AM PDT
+UPDATE AD_Process_Para SET FieldLength=40,Updated=TO_TIMESTAMP('2016-05-05 11:48:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=123
+;
+
+SELECT register_migration_script('201605051202_IDEMPIERE-3090.sql') FROM dual
+;
+
diff --git a/migration/i3.1/postgresql/201605052331_IDEMPIERE-2020.sql b/migration/i3.1/postgresql/201605052331_IDEMPIERE-2020.sql
new file mode 100644
index 0000000000..2837baada8
--- /dev/null
+++ b/migration/i3.1/postgresql/201605052331_IDEMPIERE-2020.sql
@@ -0,0 +1,246 @@
+-- IDEMPIERE-2020 Value Format for ZK
+-- Feb 25, 2015 5:45:01 PM COT
+UPDATE AD_Column SET ReadOnlyLogic=NULL,Updated=TO_TIMESTAMP('2015-02-25 17:45:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1179
+;
+
+-- Feb 25, 2015 5:54:41 PM COT
+INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (211839,0,'Value Format','Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"','Validation elements:
+ (Space) any character
+_ Space (fixed character)
+l any Letter a..Z NO space
+L any Letter a..Z NO space converted to upper case
+o any Letter a..Z or space
+O any Letter a..Z or space converted to upper case
+a any Letters & Digits NO space
+A any Letters & Digits NO space converted to upper case
+c any Letters & Digits or space
+C any Letters & Digits or space converted to upper case
+0 Digits 0..9 NO space
+9 Digits 0..9 or space
+
+Example of format "(000)_000-0000"',107,'VFormat',255,'N','N','N','N','N',0,'N',10,0,0,'Y',TO_TIMESTAMP('2015-02-25 17:54:41','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-02-25 17:54:41','YYYY-MM-DD HH24:MI:SS'),100,616,'Y','N','D','N','N','N','Y','a585debb-2c2f-4a8f-89c9-28281fd44b62','Y',0,'N','N')
+;
+
+-- Feb 25, 2015 5:55:50 PM COT
+UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2015-02-25 17:55:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1179
+;
+
+-- Feb 25, 2015 5:55:52 PM COT
+INSERT INTO t_alter_column values('ad_column','VFormat','VARCHAR(255)',null,'NULL')
+;
+
+-- Feb 25, 2015 5:56:14 PM COT
+UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2015-02-25 17:56:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3740
+;
+
+-- Feb 25, 2015 5:56:15 PM COT
+INSERT INTO t_alter_column values('ad_process_para','VFormat','VARCHAR(255)',null,'NULL')
+;
+
+-- Feb 25, 2015 5:57:01 PM COT
+INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (211840,0,'Value Format','Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"','Validation elements:
+ (Space) any character
+_ Space (fixed character)
+l any Letter a..Z NO space
+L any Letter a..Z NO space converted to upper case
+o any Letter a..Z or space
+O any Letter a..Z or space converted to upper case
+a any Letters & Digits NO space
+A any Letters & Digits NO space converted to upper case
+c any Letters & Digits or space
+C any Letters & Digits or space converted to upper case
+0 Digits 0..9 NO space
+9 Digits 0..9 or space
+
+Example of format "(000)_000-0000"',464,'VFormat',255,'N','N','N','N','N',0,'N',10,0,0,'Y',TO_TIMESTAMP('2015-02-25 17:57:00','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-02-25 17:57:00','YYYY-MM-DD HH24:MI:SS'),100,616,'Y','N','U','N','N','N','Y','35514060-1c96-435d-b3bf-101ed064d4f6','Y',0,'N','N')
+;
+
+-- Feb 25, 2015 5:57:03 PM COT
+ALTER TABLE AD_UserDef_Field ADD COLUMN VFormat VARCHAR(255) DEFAULT NULL
+;
+
+-- Feb 25, 2015 5:57:30 PM COT
+INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (203499,'Value Format','Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"','Validation elements:
+ (Space) any character
+_ Space (fixed character)
+l any Letter a..Z NO space
+L any Letter a..Z NO space converted to upper case
+o any Letter a..Z or space
+O any Letter a..Z or space converted to upper case
+a any Letters & Digits NO space
+A any Letters & Digits NO space converted to upper case
+c any Letters & Digits or space
+C any Letters & Digits or space converted to upper case
+0 Digits 0..9 NO space
+9 Digits 0..9 or space
+
+Example of format "(000)_000-0000"',395,211840,'Y',255,290,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2015-02-25 17:57:30','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-02-25 17:57:30','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','U','f8a92fba-ee26-4ccc-95ed-62dcfd3d7207','Y',290,5)
+;
+
+-- Feb 25, 2015 6:00:15 PM COT
+ALTER TABLE AD_Field ADD COLUMN VFormat VARCHAR(255) DEFAULT NULL
+;
+
+-- Feb 25, 2015 6:04:12 PM COT
+UPDATE AD_Field SET IsDisplayed='Y', SeqNo=270, XPosition=1,Updated=TO_TIMESTAMP('2015-02-25 18:04:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203499
+;
+
+-- Feb 25, 2015 6:04:12 PM COT
+UPDATE AD_Field SET SeqNo=280,Updated=TO_TIMESTAMP('2015-02-25 18:04:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5051
+;
+
+-- Feb 25, 2015 6:04:12 PM COT
+UPDATE AD_Field SET SeqNo=290,Updated=TO_TIMESTAMP('2015-02-25 18:04:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5057
+;
+
+-- Feb 25, 2015 6:04:41 PM COT
+INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (203500,'Value Format','Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"','Validation elements:
+ (Space) any character
+_ Space (fixed character)
+l any Letter a..Z NO space
+L any Letter a..Z NO space converted to upper case
+o any Letter a..Z or space
+O any Letter a..Z or space converted to upper case
+a any Letters & Digits NO space
+A any Letters & Digits NO space converted to upper case
+c any Letters & Digits or space
+C any Letters & Digits or space converted to upper case
+0 Digits 0..9 NO space
+9 Digits 0..9 or space
+
+Example of format "(000)_000-0000"',107,211839,'Y',255,410,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2015-02-25 18:04:41','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-02-25 18:04:41','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','8eb1b299-24e3-4c1b-bbc6-5c3b92e1adf8','Y',400,5)
+;
+
+-- Feb 25, 2015 6:05:15 PM COT
+UPDATE AD_Field SET SeqNo=250,Updated=TO_TIMESTAMP('2015-02-25 18:05:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=141
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=260,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200350
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=270,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200348
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=280,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200349
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=290,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13425
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=300,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200837
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=310,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54402
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=320,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54401
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=330,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200838
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=340,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200834
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=350,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13424
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=360,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62468
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=370,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53280
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=380,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200836
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=390,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200835
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET IsDisplayed='Y', SeqNo=400, XPosition=1,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203500
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=410,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=136
+;
+
+-- Feb 25, 2015 6:05:16 PM COT
+UPDATE AD_Field SET SeqNo=420,Updated=TO_TIMESTAMP('2015-02-25 18:05:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=139
+;
+
+CREATE OR REPLACE VIEW ad_field_v AS
+ SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, f.name, f.description,
+ f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading,
+ f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql,
+ c.fieldlength, COALESCE(f.vformat, c.vformat) AS vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent,
+ COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
+ COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout,
+ COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
+ COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id,
+ COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable,
+ COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic,
+ COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic,
+ COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn,
+ c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fg.name AS fieldgroup,
+ vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault,
+ COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
+ COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection,
+ f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton,
+ c.formatpattern, f.isadvancedfield, f.IsDefaultFocus, c.AD_Chart_ID
+ FROM ad_field f
+ JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
+ LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
+ LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
+ JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
+ LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
+ WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar
+;
+
+CREATE OR REPLACE VIEW ad_field_vt AS
+ SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id,
+ trl.name, trl.description, trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno,
+ f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, f.obscuretype,
+c.columnname, c.columnsql, c.fieldlength, COALESCE(f.vformat, c.vformat) AS vformat,
+COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent,
+COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
+COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout,
+COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
+COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id,
+COALESCE(f.isalwaysupdateable, c.isalwaysupdateable) AS isalwaysupdateable,
+COALESCE(f.readonlylogic, c.readonlylogic) AS readonlylogic,
+COALESCE(f.mandatorylogic, c.mandatorylogic) AS mandatorylogic,
+COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.isencrypted AS isencryptedcolumn,
+c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode,
+f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault,
+COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
+COALESCE(f.isallowcopy, c.isallowcopy) AS isallowcopy, f.isdisplayedgrid, f.seqnogrid, c.seqnoselection,
+f.xposition, f.columnspan, f.numlines, COALESCE(f.istoolbarbutton, c.istoolbarbutton) AS istoolbarbutton,
+c.formatpattern, f.isadvancedfield, f.IsDefaultFocus, c.AD_Chart_ID
+ FROM ad_field f
+ JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
+ JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
+ LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
+ LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text
+ LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
+ JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
+ LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
+ WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar
+;
+
+SELECT register_migration_script('201605052331_IDEMPIERE-2020.sql') FROM dual
+;
diff --git a/migration/i3.1/postgresql/201605082126_IDEMPIERE-3065.sql b/migration/i3.1/postgresql/201605082126_IDEMPIERE-3065.sql
new file mode 100644
index 0000000000..6026cc5766
--- /dev/null
+++ b/migration/i3.1/postgresql/201605082126_IDEMPIERE-3065.sql
@@ -0,0 +1,8 @@
+-- IDEMPIERE-3065 Sales Pipeline Chart hardcode
+-- Apr 1, 2016 8:11:34 PM ICT
+UPDATE AD_ChartDatasource SET Description=NULL, WhereClause='o.IsActive=''Y'' AND s.IsClosed=''N ''and o.SalesRep_ID=@#AD_User_ID@',Updated=TO_TIMESTAMP('2016-04-01 20:11:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ChartDatasource_ID=50000
+;
+
+SELECT register_migration_script('201605082126_IDEMPIERE-3065.sql') FROM dual
+;
+
diff --git a/migration/i3.1/postgresql/201605091119_IDEMPIERE-3093.sql b/migration/i3.1/postgresql/201605091119_IDEMPIERE-3093.sql
new file mode 100644
index 0000000000..3ce1422983
--- /dev/null
+++ b/migration/i3.1/postgresql/201605091119_IDEMPIERE-3093.sql
@@ -0,0 +1,11 @@
+-- IDEMPIERE-3093 Product fields not showing identifiers in some windows
+-- May 9, 2016 11:18:56 AM PDT
+UPDATE AD_Ref_Table SET IsValueDisplayed='Y',Updated=TO_TIMESTAMP('2016-05-09 11:18:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID IN (161,
+162,
+171,
+211)
+;
+
+SELECT register_migration_script('201605091119_IDEMPIERE-3093.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 071361b547..322ddcc852 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
@@ -73,21 +73,40 @@ public class CostAdjustmentCalloutFactory implements IColumnCalloutFactory {
mTab.setValue(I_M_InventoryLine.COLUMNNAME_CurrentCostPrice, BigDecimal.ZERO);
mTab.setValue(I_M_InventoryLine.COLUMNNAME_NewCostPrice, BigDecimal.ZERO);
} else {
- MProduct product = MProduct.get(ctx, (Integer) value);
+ MProduct product = MProduct.get(ctx, (Integer) value);
MClient client = MClient.get(ctx);
MAcctSchema as = client.getAcctSchema();
- Object asiValue = mTab.getValue(I_M_InventoryLine.COLUMNNAME_M_AttributeSetInstance_ID);
- int M_ASI_ID = asiValue != null ? (Integer)asiValue : 0;
- int AD_Org_ID = inventory.getAD_Org_ID();
- MCost cost = product.getCostingRecord(as, AD_Org_ID, M_ASI_ID, costingMethod);
- if (cost == null) {
- if (!MCostElement.COSTINGMETHOD_StandardCosting.equals(costingMethod)) {
- mTab.setValue(mField, null);
- return Msg.getMsg(Env.getCtx(), "NoCostingRecord");
+
+ String costingLevel = product.getCostingLevel(as);
+ if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(costingLevel)) {
+ mTab.setValue(I_M_InventoryLine.COLUMNNAME_CurrentCostPrice, BigDecimal.ZERO);
+ mTab.setValue(I_M_InventoryLine.COLUMNNAME_NewCostPrice, BigDecimal.ZERO);
+ }else {
+ Object asiValue = mTab.getValue(I_M_InventoryLine.COLUMNNAME_M_AttributeSetInstance_ID);
+ int M_ASI_ID = asiValue != null ? (Integer)asiValue : 0;
+ int AD_Org_ID = inventory.getAD_Org_ID();
+ int C_Currency_ID = inventory.getC_Currency_ID();
+
+ if (as.getC_Currency_ID() != C_Currency_ID)
+ {
+ MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(ctx, client.get_ID());
+ for (int i = 0; i < ass.length ; i ++)
+ {
+ MAcctSchema a = ass[i];
+ if (a.getC_Currency_ID() == C_Currency_ID)
+ as = a ;
+ }
}
- } else {
+ MCost cost = product.getCostingRecord(as, AD_Org_ID, M_ASI_ID, costingMethod);
+ if (cost == null) {
+ if (!MCostElement.COSTINGMETHOD_StandardCosting.equals(costingMethod)) {
+ mTab.setValue(mField, null);
+ return Msg.getMsg(Env.getCtx(), "NoCostingRecord");
+ }
+ }
+
mTab.setValue(I_M_InventoryLine.COLUMNNAME_CurrentCostPrice, cost.getCurrentCostPrice());
- mTab.setValue(I_M_InventoryLine.COLUMNNAME_NewCostPrice, cost.getCurrentCostPrice());
+ mTab.setValue(I_M_InventoryLine.COLUMNNAME_NewCostPrice, cost.getCurrentCostPrice());
}
}
}
@@ -111,9 +130,29 @@ public class CostAdjustmentCalloutFactory implements IColumnCalloutFactory {
MProduct product = MProduct.get(ctx, (Integer)productValue);
int M_ASI_ID = value != null ? (Integer)value : 0;
int AD_Org_ID = inventory.getAD_Org_ID();
+ int C_Currency_ID = inventory.getC_Currency_ID();
+
MClient client = MClient.get(ctx);
MAcctSchema as = client.getAcctSchema();
+
+ if (as.getC_Currency_ID() != C_Currency_ID)
+ {
+ MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(ctx, client.get_ID());
+ for (int i = 0; i < ass.length ; i ++)
+ {
+ MAcctSchema a = ass[i];
+ if (a.getC_Currency_ID() == C_Currency_ID)
+ as = a ;
+ }
+ }
MCost cost = product.getCostingRecord(as, AD_Org_ID, M_ASI_ID, costingMethod);
+ if (cost == null) {
+ if (!MCostElement.COSTINGMETHOD_StandardCosting.equals(costingMethod)) {
+ mTab.setValue(mField, null);
+ return Msg.getMsg(Env.getCtx(), "NoCostingRecord");
+ }
+ }
+
if (cost != null) {
BigDecimal currentCost = (BigDecimal) mTab.getValue(I_M_InventoryLine.COLUMNNAME_CurrentCostPrice);
if (currentCost == null || currentCost.compareTo(cost.getCurrentCostPrice())==0) return null;
@@ -121,6 +160,7 @@ public class CostAdjustmentCalloutFactory implements IColumnCalloutFactory {
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/ConvertLead.java b/org.adempiere.base.process/src/org/compiere/process/ConvertLead.java
index c55bdff124..0a7394c48d 100644
--- a/org.adempiere.base.process/src/org/compiere/process/ConvertLead.java
+++ b/org.adempiere.base.process/src/org/compiere/process/ConvertLead.java
@@ -19,15 +19,19 @@ package org.compiere.process;
import java.math.BigDecimal;
import java.sql.Timestamp;
+import java.util.List;
import java.util.logging.Level;
import org.adempiere.exceptions.FillMandatoryException;
+import org.compiere.model.I_C_ContactActivity;
import org.compiere.model.MBPartner;
import org.compiere.model.MBPartnerLocation;
import org.compiere.model.MLocation;
import org.compiere.model.MOpportunity;
import org.compiere.model.MUser;
import org.compiere.model.PO;
+import org.compiere.model.Query;
+import org.compiere.model.X_C_ContactActivity;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.DB;
import org.compiere.util.Env;
@@ -140,6 +144,18 @@ public class ConvertLead extends SvrProcess {
op.saveEx();
addBufferLog(op.getC_Opportunity_ID(), null, null, "@C_Opportunity_ID@ @Created@", MOpportunity.Table_ID, op.getC_Opportunity_ID());
+
+ List activities = new Query(getCtx(), I_C_ContactActivity.Table_Name, "AD_User_ID=?", get_TrxName())
+ .setOnlyActiveRecords(true).setClient_ID()
+ .setParameters(p_AD_User_ID)
+ .list();
+
+ for ( X_C_ContactActivity activity : activities )
+ {
+ activity.setC_Opportunity_ID(op.getC_Opportunity_ID());
+ activity.saveEx();
+ } // for each activity
+
}
lead.setIsSalesLead(false);
diff --git a/org.adempiere.base/src/org/adempiere/apps/graph/ChartBuilder.java b/org.adempiere.base/src/org/adempiere/apps/graph/ChartBuilder.java
index 165dcd9f14..08b92f5e70 100644
--- a/org.adempiere.base/src/org/adempiere/apps/graph/ChartBuilder.java
+++ b/org.adempiere.base/src/org/adempiere/apps/graph/ChartBuilder.java
@@ -40,6 +40,7 @@ import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.chart.renderer.category.CategoryItemRenderer;
+import org.jfree.chart.renderer.category.GroupedStackedBarRenderer;
import org.jfree.chart.renderer.category.StandardBarPainter;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
@@ -520,7 +521,7 @@ public class ChartBuilder {
);
- BarRenderer renderer = new BarRenderer();
+ GroupedStackedBarRenderer renderer = new GroupedStackedBarRenderer();
renderer.setBarPainter(new StandardBarPainter());
CategoryPlot plot = chart.getCategoryPlot();
diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java b/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java
index 750d724da8..7b14efd797 100644
--- a/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java
+++ b/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java
@@ -23,7 +23,6 @@ import java.util.logging.Level;
import org.compiere.model.MAccount;
import org.compiere.model.MAcctSchema;
-import org.compiere.model.MClient;
import org.compiere.model.MConversionRate;
import org.compiere.model.MCost;
import org.compiere.model.MCostDetail;
@@ -81,16 +80,13 @@ public class Doc_Inventory extends Doc
m_DocStatus = inventory.getDocStatus();
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
parentDocSubTypeInv = dt.getDocSubTypeInv();
- if (MDocType.DOCSUBTYPEINV_CostAdjustment.equals(parentDocSubTypeInv))
+
+ // IDEMPIERE-3046 Add Currency Field to Cost Adjustment Window
+ if (!MDocType.DOCSUBTYPEINV_CostAdjustment.equals(parentDocSubTypeInv))
{
- MClient client = MClient.get(getCtx(), inventory.getAD_Client_ID());
- int C_Currency_ID = client.getAcctSchema().getC_Currency_ID();
- setC_Currency_ID(C_Currency_ID);
- }
- else
- {
- setC_Currency_ID (NO_CURRENCY);
+ setC_Currency_ID (NO_CURRENCY);
}
+
// Contained Objects
p_lines = loadLines(inventory);
if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length);
@@ -175,7 +171,9 @@ public class Doc_Inventory extends Doc
{
// create Fact Header
Fact fact = new Fact(this, as, Fact.POST_Actual);
- setC_Currency_ID(as.getC_Currency_ID());
+
+ if (!MDocType.DOCSUBTYPEINV_CostAdjustment.equals(parentDocSubTypeInv))
+ setC_Currency_ID(as.getC_Currency_ID());
// Line pointers
FactLine dr = null;
@@ -329,7 +327,7 @@ public class Doc_Inventory extends Doc
{
costDetailAmt = MConversionRate.convert (getCtx(),
costDetailAmt, getC_Currency_ID(), as.getC_Currency_ID(),
- getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID());
+ getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID(), true);
}
// Cost Detail
if (!MCostDetail.createInventory(as, line.getAD_Org_ID(),
diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java
index b38563c10e..4c21644a1c 100644
--- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java
+++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java
@@ -299,6 +299,8 @@ public class GridFieldVO implements Serializable
vo.NumLines=userDef.getNumLines();
if (userDef.getIsToolbarButton() != null)
vo.IsToolbarButton = userDef.getIsToolbarButton();
+ if (userDef.getVFormat() != null)
+ vo.VFormat = userDef.getVFormat();
//IDEMPIERE-1120 Implement Field SeqNo customization
if (userDef.getSeqNo() > 0)
vo.SeqNo = userDef.getSeqNo();
diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java
index efa0eb2967..f4be409bd3 100644
--- a/org.adempiere.base/src/org/compiere/model/GridTable.java
+++ b/org.adempiere.base/src/org/compiere/model/GridTable.java
@@ -203,7 +203,7 @@ public class GridTable extends AbstractTableModel
/** The SELECT clause with FROM */
private String m_SQL_Select;
/** The static where clause */
- private String m_whereClause = "";
+ private String m_whereClause = "2=3";
/** Show only Processed='N' and last 24h records */
private boolean m_onlyCurrentRows = false;
/** Show only Not processed and x days */
diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Field.java b/org.adempiere.base/src/org/compiere/model/I_AD_Field.java
index ac05c64b08..5377effa2a 100644
--- a/org.adempiere.base/src/org/compiere/model/I_AD_Field.java
+++ b/org.adempiere.base/src/org/compiere/model/I_AD_Field.java
@@ -619,6 +619,21 @@ public interface I_AD_Field
*/
public int getUpdatedBy();
+ /** Column name VFormat */
+ public static final String COLUMNNAME_VFormat = "VFormat";
+
+ /** Set Value Format.
+ * Format of the value;
+ Can contain fixed format elements, Variables: "_lLoOaAcCa09"
+ */
+ public void setVFormat (String VFormat);
+
+ /** Get Value Format.
+ * Format of the value;
+ Can contain fixed format elements, Variables: "_lLoOaAcCa09"
+ */
+ public String getVFormat();
+
/** Column name XPosition */
public static final String COLUMNNAME_XPosition = "XPosition";
diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java b/org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java
index 940b81496a..86cfb60277 100644
--- a/org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java
+++ b/org.adempiere.base/src/org/compiere/model/I_AD_UserDef_Field.java
@@ -443,6 +443,21 @@ public interface I_AD_UserDef_Field
*/
public int getUpdatedBy();
+ /** Column name VFormat */
+ public static final String COLUMNNAME_VFormat = "VFormat";
+
+ /** Set Value Format.
+ * Format of the value;
+ Can contain fixed format elements, Variables: "_lLoOaAcCa09"
+ */
+ public void setVFormat (String VFormat);
+
+ /** Get Value Format.
+ * Format of the value;
+ Can contain fixed format elements, Variables: "_lLoOaAcCa09"
+ */
+ public String getVFormat();
+
/** Column name XPosition */
public static final String COLUMNNAME_XPosition = "XPosition";
diff --git a/org.adempiere.base/src/org/compiere/model/I_M_Inventory.java b/org.adempiere.base/src/org/compiere/model/I_M_Inventory.java
index 9d9329cc47..33b4a0af59 100644
--- a/org.adempiere.base/src/org/compiere/model/I_M_Inventory.java
+++ b/org.adempiere.base/src/org/compiere/model/I_M_Inventory.java
@@ -18,6 +18,7 @@ package org.compiere.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
+
import org.compiere.util.KeyNamePair;
/** Generated Interface for M_Inventory
@@ -450,4 +451,35 @@ public interface I_M_Inventory
public int getUser2_ID();
public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException;
+
+ /** Column name C_Currency_ID */
+ public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID";
+
+ /** Set Currency.
+ * The Currency for this record
+ */
+ public void setC_Currency_ID (int C_Currency_ID);
+
+ /** Get Currency.
+ * The Currency for this record
+ */
+ public int getC_Currency_ID();
+
+ public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
+
+ /** Column name C_ConversionType_ID */
+ public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID";
+
+ /** Set Currency Type.
+ * Currency Conversion Rate Type
+ */
+ public void setC_ConversionType_ID (int C_ConversionType_ID);
+
+ /** Get Currency Type.
+ * Currency Conversion Rate Type
+ */
+ public int getC_ConversionType_ID();
+
+ public org.compiere.model.I_C_ConversionType getC_ConversionType() throws RuntimeException;
+
}
diff --git a/org.adempiere.base/src/org/compiere/model/MConversionRate.java b/org.adempiere.base/src/org/compiere/model/MConversionRate.java
index e3b81bfb02..d99ba597f4 100644
--- a/org.adempiere.base/src/org/compiere/model/MConversionRate.java
+++ b/org.adempiere.base/src/org/compiere/model/MConversionRate.java
@@ -45,8 +45,8 @@ public class MConversionRate extends X_C_Conversion_Rate
/**
*
*/
- private static final long serialVersionUID = -8171829790483133141L;
-
+ private static final long serialVersionUID = -7938144674700640228L;
+
/** Logger */
private static CLogger s_log = CLogger.getCLogger (MConversionRate.class);
@@ -104,6 +104,27 @@ public class MConversionRate extends X_C_Conversion_Rate
BigDecimal Amt, int CurFrom_ID, int CurTo_ID,
Timestamp ConvDate, int C_ConversionType_ID,
int AD_Client_ID, int AD_Org_ID)
+ {
+ return convert(ctx,Amt, CurFrom_ID,CurTo_ID, ConvDate, C_ConversionType_ID, AD_Client_ID, AD_Org_ID, false);
+ } // convert
+
+ /**
+ * Convert an amount
+ * @param ctx context
+ * @param CurFrom_ID The C_Currency_ID FROM
+ * @param CurTo_ID The C_Currency_ID TO
+ * @param ConvDate conversion date - if null - use current date
+ * @param C_ConversionType_ID conversion rate type - if 0 - use Default
+ * @param Amt amount to be converted
+ * @param AD_Client_ID client
+ * @param AD_Org_ID organization
+ * @param use for costing
+ * @return converted amount or null if no rate
+ */
+ public static BigDecimal convert (Properties ctx,
+ BigDecimal Amt, int CurFrom_ID, int CurTo_ID,
+ Timestamp ConvDate, int C_ConversionType_ID,
+ int AD_Client_ID, int AD_Org_ID, boolean isCosting)
{
if (Amt == null)
throw new IllegalArgumentException("Required parameter missing - Amt");
@@ -118,13 +139,15 @@ public class MConversionRate extends X_C_Conversion_Rate
// Get Amount in Currency Precision
retValue = retValue.multiply(Amt);
- int stdPrecision = MCurrency.getStdPrecision(ctx, CurTo_ID);
+ int stdPrecision = isCosting ? MCurrency.getCostingPrecision(ctx, CurTo_ID): MCurrency.getStdPrecision(ctx, CurTo_ID);
+
if (retValue.scale() > stdPrecision)
retValue = retValue.setScale(stdPrecision, BigDecimal.ROUND_HALF_UP);
return retValue;
} // convert
+
/**
* Sets system spot conversion rate for a single day.
* Checks for overlaps of spot rate is made. If an overlap is found, the overlapping
diff --git a/org.adempiere.base/src/org/compiere/model/MCurrency.java b/org.adempiere.base/src/org/compiere/model/MCurrency.java
index 12f9da1bb4..daf865d361 100644
--- a/org.adempiere.base/src/org/compiere/model/MCurrency.java
+++ b/org.adempiere.base/src/org/compiere/model/MCurrency.java
@@ -31,7 +31,7 @@ public class MCurrency extends X_C_Currency
/**
*
*/
- private static final long serialVersionUID = 5549233389514285323L;
+ private static final long serialVersionUID = 2262097171335518186L;
/**
* Currency Constructor
@@ -183,6 +183,17 @@ public class MCurrency extends X_C_Currency
return msgreturn.toString();
} // toString
+ /**
+ * Get Costing Precision.
+ * @param ctx Context
+ * @param C_Currency_ID currency
+ * @return Costing Precision
+ */
+ public static int getCostingPrecision(Properties ctx, int C_Currency_ID) {
+ MCurrency c = get(ctx, C_Currency_ID);
+ return c.getCostingPrecision();
+ }
+
/*************************************************************************/
diff --git a/org.adempiere.base/src/org/compiere/model/MInventory.java b/org.adempiere.base/src/org/compiere/model/MInventory.java
index b8366dc0ca..553dde6538 100644
--- a/org.adempiere.base/src/org/compiere/model/MInventory.java
+++ b/org.adempiere.base/src/org/compiere/model/MInventory.java
@@ -454,6 +454,18 @@ public class MInventory extends X_M_Inventory implements DocAction
BigDecimal currentCost = line.getCurrentCostPrice();
MClient client = MClient.get(getCtx(), getAD_Client_ID());
MAcctSchema as = client.getAcctSchema();
+ MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(getCtx(), client.get_ID());
+
+ if (as.getC_Currency_ID() != getC_Currency_ID())
+ {
+ for (int i = 0; i < ass.length ; i ++)
+ {
+ MAcctSchema a = ass[i];
+ if (a.getC_Currency_ID() == getC_Currency_ID())
+ as = a ;
+ }
+ }
+
MCost cost = product.getCostingRecord(as, getAD_Org_ID(), line.getM_AttributeSetInstance_ID(), getCostingMethod());
if (cost != null && cost.getCurrentCostPrice().compareTo(currentCost) != 0)
{
@@ -1013,16 +1025,6 @@ public class MInventory extends X_M_Inventory implements DocAction
return getUpdatedBy();
} // getDoc_User_ID
- /**
- * Get Document Currency
- * @return C_Currency_ID
- */
- public int getC_Currency_ID()
- {
- // MPriceList pl = MPriceList.get(getCtx(), getM_PriceList_ID());
- // return pl.getC_Currency_ID();
- return 0;
- } // getC_Currency_ID
/** Reversal Flag */
private boolean m_reversal = false;
diff --git a/org.adempiere.base/src/org/compiere/model/MInventoryLine.java b/org.adempiere.base/src/org/compiere/model/MInventoryLine.java
index aff95b4e8b..1af380e54b 100644
--- a/org.adempiere.base/src/org/compiere/model/MInventoryLine.java
+++ b/org.adempiere.base/src/org/compiere/model/MInventoryLine.java
@@ -353,11 +353,6 @@ public class MInventoryLine extends X_M_InventoryLine
return false;
}
} else if (MDocType.DOCSUBTYPEINV_CostAdjustment.equals(docSubTypeInv)) {
- if (getNewCostPrice().signum() == 0) {
- log.saveError("FillMandatory", Msg.getElement(getCtx(), COLUMNNAME_NewCostPrice));
- return false;
- }
-
int M_ASI_ID = getM_AttributeSetInstance_ID();
MProduct product = new MProduct(getCtx(), getM_Product_ID(), get_TrxName());
MClient client = MClient.get(getCtx());
diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java
index cb424539be..e922b9f2da 100644
--- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java
+++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java
@@ -404,6 +404,7 @@ public class MLookupFactory
}
StringBuilder key = new StringBuilder()
.append(Env.getAD_Client_ID(ctx)).append("|")
+ .append(Env.getAD_Role_ID(ctx)).append("|")
.append(Env.getAD_User_ID(ctx)).append("|")
.append(lang).append("|")
.append(String.valueOf(AD_Reference_Value_ID));
@@ -752,6 +753,7 @@ public class MLookupFactory
//try cache
StringBuilder cacheKey = new StringBuilder()
.append(Env.getAD_Client_ID(ctx)).append("|")
+ .append(Env.getAD_Role_ID(ctx)).append("|")
.append(Env.getAD_User_ID(ctx)).append("|")
.append(language.getAD_Language()).append("|")
.append(TableName).append(".")
diff --git a/org.adempiere.base/src/org/compiere/model/MPeriod.java b/org.adempiere.base/src/org/compiere/model/MPeriod.java
index bd636a89ce..9497281ad4 100644
--- a/org.adempiere.base/src/org/compiere/model/MPeriod.java
+++ b/org.adempiere.base/src/org/compiere/model/MPeriod.java
@@ -346,7 +346,7 @@ public class MPeriod extends X_C_Period
s_log.warning("Could not find C_DocType_ID (null or not Integer) for " + table.getTableName());
return true;
}
- if (doctypeID == 0 && tableID == MOrder.Table_ID) {
+ if (doctypeID == 0 && (tableID == MOrder.Table_ID || tableID == MInvoice.Table_ID)) {
idxdoctype = po.get_ColumnIndex("C_DocTypeTarget_ID");
objint = po.get_Value(idxdoctype);
if (objint != null && objint instanceof Integer) {
diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Field.java b/org.adempiere.base/src/org/compiere/model/X_AD_Field.java
index 938455d6dd..c537d5f130 100644
--- a/org.adempiere.base/src/org/compiere/model/X_AD_Field.java
+++ b/org.adempiere.base/src/org/compiere/model/X_AD_Field.java
@@ -32,7 +32,7 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
/**
*
*/
- private static final long serialVersionUID = 20151030L;
+ private static final long serialVersionUID = 20160505L;
/** Standard Constructor */
public X_AD_Field (Properties ctx, int AD_Field_ID, String trxName)
@@ -986,6 +986,23 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return bd;
}
+ /** Set Value Format.
+ @param VFormat
+ Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"
+ */
+ public void setVFormat (String VFormat)
+ {
+ set_Value (COLUMNNAME_VFormat, VFormat);
+ }
+
+ /** Get Value Format.
+ @return Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"
+ */
+ public String getVFormat ()
+ {
+ return (String)get_Value(COLUMNNAME_VFormat);
+ }
+
/** Set X Position.
@param XPosition
Absolute X (horizontal) position in 1/72 of an inch
diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java b/org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java
index 0824f22336..918d538ed8 100644
--- a/org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java
+++ b/org.adempiere.base/src/org/compiere/model/X_AD_UserDef_Field.java
@@ -30,7 +30,7 @@ public class X_AD_UserDef_Field extends PO implements I_AD_UserDef_Field, I_Pers
/**
*
*/
- private static final long serialVersionUID = 20151030L;
+ private static final long serialVersionUID = 20160505L;
/** Standard Constructor */
public X_AD_UserDef_Field (Properties ctx, int AD_UserDef_Field_ID, String trxName)
@@ -639,6 +639,23 @@ public class X_AD_UserDef_Field extends PO implements I_AD_UserDef_Field, I_Pers
return ii.intValue();
}
+ /** Set Value Format.
+ @param VFormat
+ Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"
+ */
+ public void setVFormat (String VFormat)
+ {
+ set_Value (COLUMNNAME_VFormat, VFormat);
+ }
+
+ /** Get Value Format.
+ @return Format of the value; Can contain fixed format elements, Variables: "_lLoOaAcCa09"
+ */
+ public String getVFormat ()
+ {
+ return (String)get_Value(COLUMNNAME_VFormat);
+ }
+
/** Set X Position.
@param XPosition
Absolute X (horizontal) position in 1/72 of an inch
diff --git a/org.adempiere.base/src/org/compiere/model/X_M_Inventory.java b/org.adempiere.base/src/org/compiere/model/X_M_Inventory.java
index e529625c58..6793b7de95 100644
--- a/org.adempiere.base/src/org/compiere/model/X_M_Inventory.java
+++ b/org.adempiere.base/src/org/compiere/model/X_M_Inventory.java
@@ -21,198 +21,206 @@ import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
+
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
-/** Generated Model for M_Inventory
- * @author iDempiere (generated)
- * @version Release 3.1 - $Id$ */
-public class X_M_Inventory extends PO implements I_M_Inventory, I_Persistent
-{
+/**
+ * Generated Model for M_Inventory
+ *
+ * @author iDempiere (generated)
+ * @version Release 3.1 - $Id$
+ */
+public class X_M_Inventory extends PO implements I_M_Inventory, I_Persistent {
/**
*
*/
- private static final long serialVersionUID = 20151030L;
+ private static final long serialVersionUID = 20160303L;
- /** Standard Constructor */
- public X_M_Inventory (Properties ctx, int M_Inventory_ID, String trxName)
- {
- super (ctx, M_Inventory_ID, trxName);
- /** if (M_Inventory_ID == 0)
- {
- setC_DocType_ID (0);
- setDocAction (null);
-// CO
- setDocStatus (null);
-// DR
- setDocumentNo (null);
- setIsApproved (false);
- setM_Inventory_ID (0);
- setMovementDate (new Timestamp( System.currentTimeMillis() ));
-// @#Date@
- setPosted (false);
- setProcessed (false);
- } */
- }
-
- /** Load Constructor */
- public X_M_Inventory (Properties ctx, ResultSet rs, String trxName)
- {
- super (ctx, rs, trxName);
- }
-
- /** AccessLevel
- * @return 1 - Org
- */
- protected int get_AccessLevel()
- {
- return accessLevel.intValue();
- }
-
- /** Load Meta Data */
- protected POInfo initPO (Properties ctx)
- {
- POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
- return poi;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer ("X_M_Inventory[")
- .append(get_ID()).append("]");
- return sb.toString();
- }
-
- /** Set Trx Organization.
- @param AD_OrgTrx_ID
- Performing or initiating organization
- */
- public void setAD_OrgTrx_ID (int AD_OrgTrx_ID)
- {
- if (AD_OrgTrx_ID < 1)
- set_Value (COLUMNNAME_AD_OrgTrx_ID, null);
- else
- set_Value (COLUMNNAME_AD_OrgTrx_ID, Integer.valueOf(AD_OrgTrx_ID));
+ /** Standard Constructor */
+ public X_M_Inventory(Properties ctx, int M_Inventory_ID, String trxName) {
+ super(ctx, M_Inventory_ID, trxName);
+ /**
+ * if (M_Inventory_ID == 0) { setC_DocType_ID (0); setDocAction (null);
+ * // CO setDocStatus (null); // DR setDocumentNo (null); setIsApproved
+ * (false); setM_Inventory_ID (0); setMovementDate (new Timestamp(
+ * System.currentTimeMillis() )); // @#Date@ setPosted (false);
+ * setProcessed (false); }
+ */
}
- /** Get Trx Organization.
- @return Performing or initiating organization
- */
- public int getAD_OrgTrx_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgTrx_ID);
+ /** Load Constructor */
+ public X_M_Inventory(Properties ctx, ResultSet rs, String trxName) {
+ super(ctx, rs, trxName);
+ }
+
+ /**
+ * AccessLevel
+ *
+ * @return 1 - Org
+ */
+ protected int get_AccessLevel() {
+ return accessLevel.intValue();
+ }
+
+ /** Load Meta Data */
+ protected POInfo initPO(Properties ctx) {
+ POInfo poi = POInfo.getPOInfo(ctx, Table_ID, get_TrxName());
+ return poi;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("X_M_Inventory[").append(get_ID())
+ .append("]");
+ return sb.toString();
+ }
+
+ /**
+ * Set Trx Organization.
+ *
+ * @param AD_OrgTrx_ID
+ * Performing or initiating organization
+ */
+ public void setAD_OrgTrx_ID(int AD_OrgTrx_ID) {
+ if (AD_OrgTrx_ID < 1)
+ set_Value(COLUMNNAME_AD_OrgTrx_ID, null);
+ else
+ set_Value(COLUMNNAME_AD_OrgTrx_ID, Integer.valueOf(AD_OrgTrx_ID));
+ }
+
+ /**
+ * Get Trx Organization.
+ *
+ * @return Performing or initiating organization
+ */
+ public int getAD_OrgTrx_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_AD_OrgTrx_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- /** Set Approval Amount.
- @param ApprovalAmt
- Document Approval Amount
- */
- public void setApprovalAmt (BigDecimal ApprovalAmt)
- {
- set_Value (COLUMNNAME_ApprovalAmt, ApprovalAmt);
+ /**
+ * Set Approval Amount.
+ *
+ * @param ApprovalAmt
+ * Document Approval Amount
+ */
+ public void setApprovalAmt(BigDecimal ApprovalAmt) {
+ set_Value(COLUMNNAME_ApprovalAmt, ApprovalAmt);
}
- /** Get Approval Amount.
- @return Document Approval Amount
- */
- public BigDecimal getApprovalAmt ()
- {
- BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ApprovalAmt);
+ /**
+ * Get Approval Amount.
+ *
+ * @return Document Approval Amount
+ */
+ public BigDecimal getApprovalAmt() {
+ BigDecimal bd = (BigDecimal) get_Value(COLUMNNAME_ApprovalAmt);
if (bd == null)
- return Env.ZERO;
+ return Env.ZERO;
return bd;
}
- public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException
- {
- return (org.compiere.model.I_C_Activity)MTable.get(getCtx(), org.compiere.model.I_C_Activity.Table_Name)
- .getPO(getC_Activity_ID(), get_TrxName()); }
-
- /** Set Activity.
- @param C_Activity_ID
- Business Activity
- */
- public void setC_Activity_ID (int C_Activity_ID)
- {
- if (C_Activity_ID < 1)
- set_Value (COLUMNNAME_C_Activity_ID, null);
- else
- set_Value (COLUMNNAME_C_Activity_ID, Integer.valueOf(C_Activity_ID));
+ public org.compiere.model.I_C_Activity getC_Activity()
+ throws RuntimeException {
+ return (org.compiere.model.I_C_Activity) MTable.get(getCtx(),
+ org.compiere.model.I_C_Activity.Table_Name).getPO(
+ getC_Activity_ID(), get_TrxName());
}
- /** Get Activity.
- @return Business Activity
- */
- public int getC_Activity_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_C_Activity_ID);
+ /**
+ * Set Activity.
+ *
+ * @param C_Activity_ID
+ * Business Activity
+ */
+ public void setC_Activity_ID(int C_Activity_ID) {
+ if (C_Activity_ID < 1)
+ set_Value(COLUMNNAME_C_Activity_ID, null);
+ else
+ set_Value(COLUMNNAME_C_Activity_ID, Integer.valueOf(C_Activity_ID));
+ }
+
+ /**
+ * Get Activity.
+ *
+ * @return Business Activity
+ */
+ public int getC_Activity_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_C_Activity_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- public org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException
- {
- return (org.compiere.model.I_C_Campaign)MTable.get(getCtx(), org.compiere.model.I_C_Campaign.Table_Name)
- .getPO(getC_Campaign_ID(), get_TrxName()); }
-
- /** Set Campaign.
- @param C_Campaign_ID
- Marketing Campaign
- */
- public void setC_Campaign_ID (int C_Campaign_ID)
- {
- if (C_Campaign_ID < 1)
- set_Value (COLUMNNAME_C_Campaign_ID, null);
- else
- set_Value (COLUMNNAME_C_Campaign_ID, Integer.valueOf(C_Campaign_ID));
+ public org.compiere.model.I_C_Campaign getC_Campaign()
+ throws RuntimeException {
+ return (org.compiere.model.I_C_Campaign) MTable.get(getCtx(),
+ org.compiere.model.I_C_Campaign.Table_Name).getPO(
+ getC_Campaign_ID(), get_TrxName());
}
- /** Get Campaign.
- @return Marketing Campaign
- */
- public int getC_Campaign_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_C_Campaign_ID);
+ /**
+ * Set Campaign.
+ *
+ * @param C_Campaign_ID
+ * Marketing Campaign
+ */
+ public void setC_Campaign_ID(int C_Campaign_ID) {
+ if (C_Campaign_ID < 1)
+ set_Value(COLUMNNAME_C_Campaign_ID, null);
+ else
+ set_Value(COLUMNNAME_C_Campaign_ID, Integer.valueOf(C_Campaign_ID));
+ }
+
+ /**
+ * Get Campaign.
+ *
+ * @return Marketing Campaign
+ */
+ public int getC_Campaign_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_C_Campaign_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException
- {
- return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name)
- .getPO(getC_DocType_ID(), get_TrxName()); }
-
- /** Set Document Type.
- @param C_DocType_ID
- Document type or rules
- */
- public void setC_DocType_ID (int C_DocType_ID)
- {
- if (C_DocType_ID < 0)
- set_Value (COLUMNNAME_C_DocType_ID, null);
- else
- set_Value (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID));
+ public org.compiere.model.I_C_DocType getC_DocType()
+ throws RuntimeException {
+ return (org.compiere.model.I_C_DocType) MTable.get(getCtx(),
+ org.compiere.model.I_C_DocType.Table_Name).getPO(
+ getC_DocType_ID(), get_TrxName());
}
- /** Get Document Type.
- @return Document type or rules
- */
- public int getC_DocType_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_C_DocType_ID);
+ /**
+ * Set Document Type.
+ *
+ * @param C_DocType_ID
+ * Document type or rules
+ */
+ public void setC_DocType_ID(int C_DocType_ID) {
+ if (C_DocType_ID < 0)
+ set_Value(COLUMNNAME_C_DocType_ID, null);
+ else
+ set_Value(COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID));
+ }
+
+ /**
+ * Get Document Type.
+ *
+ * @return Document type or rules
+ */
+ public int getC_DocType_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_C_DocType_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
/** CostingMethod AD_Reference_ID=122 */
- public static final int COSTINGMETHOD_AD_Reference_ID=122;
+ public static final int COSTINGMETHOD_AD_Reference_ID = 122;
/** Standard Costing = S */
public static final String COSTINGMETHOD_StandardCosting = "S";
/** Average PO = A */
@@ -231,71 +239,80 @@ public class X_M_Inventory extends PO implements I_M_Inventory, I_Persistent
public static final String COSTINGMETHOD_UserDefined = "U";
/** _ = x */
public static final String COSTINGMETHOD__ = "x";
- /** Set Costing Method.
- @param CostingMethod
- Indicates how Costs will be calculated
- */
- public void setCostingMethod (String CostingMethod)
- {
- set_Value (COLUMNNAME_CostingMethod, CostingMethod);
+ /**
+ * Set Costing Method.
+ *
+ * @param CostingMethod
+ * Indicates how Costs will be calculated
+ */
+ public void setCostingMethod(String CostingMethod) {
+
+ set_Value(COLUMNNAME_CostingMethod, CostingMethod);
}
- /** Get Costing Method.
- @return Indicates how Costs will be calculated
- */
- public String getCostingMethod ()
- {
- return (String)get_Value(COLUMNNAME_CostingMethod);
+ /**
+ * Get Costing Method.
+ *
+ * @return Indicates how Costs will be calculated
+ */
+ public String getCostingMethod() {
+ return (String) get_Value(COLUMNNAME_CostingMethod);
}
- public org.compiere.model.I_C_Project getC_Project() throws RuntimeException
- {
- return (org.compiere.model.I_C_Project)MTable.get(getCtx(), org.compiere.model.I_C_Project.Table_Name)
- .getPO(getC_Project_ID(), get_TrxName()); }
-
- /** Set Project.
- @param C_Project_ID
- Financial Project
- */
- public void setC_Project_ID (int C_Project_ID)
- {
- if (C_Project_ID < 1)
- set_Value (COLUMNNAME_C_Project_ID, null);
- else
- set_Value (COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID));
+ public org.compiere.model.I_C_Project getC_Project()
+ throws RuntimeException {
+ return (org.compiere.model.I_C_Project) MTable.get(getCtx(),
+ org.compiere.model.I_C_Project.Table_Name).getPO(
+ getC_Project_ID(), get_TrxName());
}
- /** Get Project.
- @return Financial Project
- */
- public int getC_Project_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID);
+ /**
+ * Set Project.
+ *
+ * @param C_Project_ID
+ * Financial Project
+ */
+ public void setC_Project_ID(int C_Project_ID) {
+ if (C_Project_ID < 1)
+ set_Value(COLUMNNAME_C_Project_ID, null);
+ else
+ set_Value(COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID));
+ }
+
+ /**
+ * Get Project.
+ *
+ * @return Financial Project
+ */
+ public int getC_Project_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_C_Project_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- /** Set Description.
- @param Description
- Optional short description of the record
- */
- public void setDescription (String Description)
- {
- set_Value (COLUMNNAME_Description, Description);
+ /**
+ * Set Description.
+ *
+ * @param Description
+ * Optional short description of the record
+ */
+ public void setDescription(String Description) {
+ set_Value(COLUMNNAME_Description, Description);
}
- /** Get Description.
- @return Optional short description of the record
- */
- public String getDescription ()
- {
- return (String)get_Value(COLUMNNAME_Description);
+ /**
+ * Get Description.
+ *
+ * @return Optional short description of the record
+ */
+ public String getDescription() {
+ return (String) get_Value(COLUMNNAME_Description);
}
/** DocAction AD_Reference_ID=135 */
- public static final int DOCACTION_AD_Reference_ID=135;
+ public static final int DOCACTION_AD_Reference_ID = 135;
/** Complete = CO */
public static final String DOCACTION_Complete = "CO";
/** Approve = AP */
@@ -324,26 +341,29 @@ public class X_M_Inventory extends PO implements I_M_Inventory, I_Persistent
public static final String DOCACTION_Unlock = "XL";
/** Wait Complete = WC */
public static final String DOCACTION_WaitComplete = "WC";
- /** Set Document Action.
- @param DocAction
- The targeted status of the document
- */
- public void setDocAction (String DocAction)
- {
- set_Value (COLUMNNAME_DocAction, DocAction);
+ /**
+ * Set Document Action.
+ *
+ * @param DocAction
+ * The targeted status of the document
+ */
+ public void setDocAction(String DocAction) {
+
+ set_Value(COLUMNNAME_DocAction, DocAction);
}
- /** Get Document Action.
- @return The targeted status of the document
- */
- public String getDocAction ()
- {
- return (String)get_Value(COLUMNNAME_DocAction);
+ /**
+ * Get Document Action.
+ *
+ * @return The targeted status of the document
+ */
+ public String getDocAction() {
+ return (String) get_Value(COLUMNNAME_DocAction);
}
/** DocStatus AD_Reference_ID=131 */
- public static final int DOCSTATUS_AD_Reference_ID=131;
+ public static final int DOCSTATUS_AD_Reference_ID = 131;
/** Drafted = DR */
public static final String DOCSTATUS_Drafted = "DR";
/** Completed = CO */
@@ -368,384 +388,507 @@ public class X_M_Inventory extends PO implements I_M_Inventory, I_Persistent
public static final String DOCSTATUS_WaitingPayment = "WP";
/** Waiting Confirmation = WC */
public static final String DOCSTATUS_WaitingConfirmation = "WC";
- /** Set Document Status.
- @param DocStatus
- The current status of the document
- */
- public void setDocStatus (String DocStatus)
- {
- set_Value (COLUMNNAME_DocStatus, DocStatus);
+ /**
+ * Set Document Status.
+ *
+ * @param DocStatus
+ * The current status of the document
+ */
+ public void setDocStatus(String DocStatus) {
+
+ set_Value(COLUMNNAME_DocStatus, DocStatus);
}
- /** Get Document Status.
- @return The current status of the document
- */
- public String getDocStatus ()
- {
- return (String)get_Value(COLUMNNAME_DocStatus);
+ /**
+ * Get Document Status.
+ *
+ * @return The current status of the document
+ */
+ public String getDocStatus() {
+ return (String) get_Value(COLUMNNAME_DocStatus);
}
- /** Set Document No.
- @param DocumentNo
- Document sequence number of the document
- */
- public void setDocumentNo (String DocumentNo)
- {
- set_Value (COLUMNNAME_DocumentNo, DocumentNo);
+ /**
+ * Set Document No.
+ *
+ * @param DocumentNo
+ * Document sequence number of the document
+ */
+ public void setDocumentNo(String DocumentNo) {
+ set_Value(COLUMNNAME_DocumentNo, DocumentNo);
}
- /** Get Document No.
- @return Document sequence number of the document
- */
- public String getDocumentNo ()
- {
- return (String)get_Value(COLUMNNAME_DocumentNo);
+ /**
+ * Get Document No.
+ *
+ * @return Document sequence number of the document
+ */
+ public String getDocumentNo() {
+ return (String) get_Value(COLUMNNAME_DocumentNo);
}
- /** Get Record ID/ColumnName
- @return ID/ColumnName pair
- */
- public KeyNamePair getKeyNamePair()
- {
- return new KeyNamePair(get_ID(), getDocumentNo());
- }
-
- /** Set Generate List.
- @param GenerateList
- Generate List
- */
- public void setGenerateList (String GenerateList)
- {
- set_Value (COLUMNNAME_GenerateList, GenerateList);
+ /**
+ * Get Record ID/ColumnName
+ *
+ * @return ID/ColumnName pair
+ */
+ public KeyNamePair getKeyNamePair() {
+ return new KeyNamePair(get_ID(), getDocumentNo());
}
- /** Get Generate List.
- @return Generate List
- */
- public String getGenerateList ()
- {
- return (String)get_Value(COLUMNNAME_GenerateList);
+ /**
+ * Set Generate List.
+ *
+ * @param GenerateList
+ * Generate List
+ */
+ public void setGenerateList(String GenerateList) {
+ set_Value(COLUMNNAME_GenerateList, GenerateList);
}
- /** Set Approved.
- @param IsApproved
- Indicates if this document requires approval
- */
- public void setIsApproved (boolean IsApproved)
- {
- set_Value (COLUMNNAME_IsApproved, Boolean.valueOf(IsApproved));
+ /**
+ * Get Generate List.
+ *
+ * @return Generate List
+ */
+ public String getGenerateList() {
+ return (String) get_Value(COLUMNNAME_GenerateList);
}
- /** Get Approved.
- @return Indicates if this document requires approval
- */
- public boolean isApproved ()
- {
+ /**
+ * Set Approved.
+ *
+ * @param IsApproved
+ * Indicates if this document requires approval
+ */
+ public void setIsApproved(boolean IsApproved) {
+ set_Value(COLUMNNAME_IsApproved, Boolean.valueOf(IsApproved));
+ }
+
+ /**
+ * Get Approved.
+ *
+ * @return Indicates if this document requires approval
+ */
+ public boolean isApproved() {
Object oo = get_Value(COLUMNNAME_IsApproved);
- if (oo != null)
- {
- if (oo instanceof Boolean)
- return ((Boolean)oo).booleanValue();
+ if (oo != null) {
+ if (oo instanceof Boolean)
+ return ((Boolean) oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
- /** Set Phys.Inventory.
- @param M_Inventory_ID
- Parameters for a Physical Inventory
- */
- public void setM_Inventory_ID (int M_Inventory_ID)
- {
- if (M_Inventory_ID < 1)
- set_ValueNoCheck (COLUMNNAME_M_Inventory_ID, null);
- else
- set_ValueNoCheck (COLUMNNAME_M_Inventory_ID, Integer.valueOf(M_Inventory_ID));
+ /**
+ * Set Phys.Inventory.
+ *
+ * @param M_Inventory_ID
+ * Parameters for a Physical Inventory
+ */
+ public void setM_Inventory_ID(int M_Inventory_ID) {
+ if (M_Inventory_ID < 1)
+ set_ValueNoCheck(COLUMNNAME_M_Inventory_ID, null);
+ else
+ set_ValueNoCheck(COLUMNNAME_M_Inventory_ID,
+ Integer.valueOf(M_Inventory_ID));
}
- /** Get Phys.Inventory.
- @return Parameters for a Physical Inventory
- */
- public int getM_Inventory_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_M_Inventory_ID);
+ /**
+ * Get Phys.Inventory.
+ *
+ * @return Parameters for a Physical Inventory
+ */
+ public int getM_Inventory_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_M_Inventory_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- /** Set M_Inventory_UU.
- @param M_Inventory_UU M_Inventory_UU */
- public void setM_Inventory_UU (String M_Inventory_UU)
- {
- set_Value (COLUMNNAME_M_Inventory_UU, M_Inventory_UU);
+ /**
+ * Set M_Inventory_UU.
+ *
+ * @param M_Inventory_UU
+ * M_Inventory_UU
+ */
+ public void setM_Inventory_UU(String M_Inventory_UU) {
+ set_Value(COLUMNNAME_M_Inventory_UU, M_Inventory_UU);
}
- /** Get M_Inventory_UU.
- @return M_Inventory_UU */
- public String getM_Inventory_UU ()
- {
- return (String)get_Value(COLUMNNAME_M_Inventory_UU);
+ /**
+ * Get M_Inventory_UU.
+ *
+ * @return M_Inventory_UU
+ */
+ public String getM_Inventory_UU() {
+ return (String) get_Value(COLUMNNAME_M_Inventory_UU);
}
- /** Set Movement Date.
- @param MovementDate
- Date a product was moved in or out of inventory
- */
- public void setMovementDate (Timestamp MovementDate)
- {
- set_Value (COLUMNNAME_MovementDate, MovementDate);
+ /**
+ * Set Movement Date.
+ *
+ * @param MovementDate
+ * Date a product was moved in or out of inventory
+ */
+ public void setMovementDate(Timestamp MovementDate) {
+ set_Value(COLUMNNAME_MovementDate, MovementDate);
}
- /** Get Movement Date.
- @return Date a product was moved in or out of inventory
- */
- public Timestamp getMovementDate ()
- {
- return (Timestamp)get_Value(COLUMNNAME_MovementDate);
+ /**
+ * Get Movement Date.
+ *
+ * @return Date a product was moved in or out of inventory
+ */
+ public Timestamp getMovementDate() {
+ return (Timestamp) get_Value(COLUMNNAME_MovementDate);
}
- public org.compiere.model.I_M_PerpetualInv getM_PerpetualInv() throws RuntimeException
- {
- return (org.compiere.model.I_M_PerpetualInv)MTable.get(getCtx(), org.compiere.model.I_M_PerpetualInv.Table_Name)
- .getPO(getM_PerpetualInv_ID(), get_TrxName()); }
-
- /** Set Perpetual Inventory.
- @param M_PerpetualInv_ID
- Rules for generating physical inventory
- */
- public void setM_PerpetualInv_ID (int M_PerpetualInv_ID)
- {
- if (M_PerpetualInv_ID < 1)
- set_ValueNoCheck (COLUMNNAME_M_PerpetualInv_ID, null);
- else
- set_ValueNoCheck (COLUMNNAME_M_PerpetualInv_ID, Integer.valueOf(M_PerpetualInv_ID));
+ public org.compiere.model.I_M_PerpetualInv getM_PerpetualInv()
+ throws RuntimeException {
+ return (org.compiere.model.I_M_PerpetualInv) MTable.get(getCtx(),
+ org.compiere.model.I_M_PerpetualInv.Table_Name).getPO(
+ getM_PerpetualInv_ID(), get_TrxName());
}
- /** Get Perpetual Inventory.
- @return Rules for generating physical inventory
- */
- public int getM_PerpetualInv_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_M_PerpetualInv_ID);
+ /**
+ * Set Perpetual Inventory.
+ *
+ * @param M_PerpetualInv_ID
+ * Rules for generating physical inventory
+ */
+ public void setM_PerpetualInv_ID(int M_PerpetualInv_ID) {
+ if (M_PerpetualInv_ID < 1)
+ set_ValueNoCheck(COLUMNNAME_M_PerpetualInv_ID, null);
+ else
+ set_ValueNoCheck(COLUMNNAME_M_PerpetualInv_ID,
+ Integer.valueOf(M_PerpetualInv_ID));
+ }
+
+ /**
+ * Get Perpetual Inventory.
+ *
+ * @return Rules for generating physical inventory
+ */
+ public int getM_PerpetualInv_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_M_PerpetualInv_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- public org.compiere.model.I_M_Warehouse getM_Warehouse() throws RuntimeException
- {
- return (org.compiere.model.I_M_Warehouse)MTable.get(getCtx(), org.compiere.model.I_M_Warehouse.Table_Name)
- .getPO(getM_Warehouse_ID(), get_TrxName()); }
-
- /** Set Warehouse.
- @param M_Warehouse_ID
- Storage Warehouse and Service Point
- */
- public void setM_Warehouse_ID (int M_Warehouse_ID)
- {
- if (M_Warehouse_ID < 1)
- set_Value (COLUMNNAME_M_Warehouse_ID, null);
- else
- set_Value (COLUMNNAME_M_Warehouse_ID, Integer.valueOf(M_Warehouse_ID));
+ public org.compiere.model.I_M_Warehouse getM_Warehouse()
+ throws RuntimeException {
+ return (org.compiere.model.I_M_Warehouse) MTable.get(getCtx(),
+ org.compiere.model.I_M_Warehouse.Table_Name).getPO(
+ getM_Warehouse_ID(), get_TrxName());
}
- /** Get Warehouse.
- @return Storage Warehouse and Service Point
- */
- public int getM_Warehouse_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_M_Warehouse_ID);
+ /**
+ * Set Warehouse.
+ *
+ * @param M_Warehouse_ID
+ * Storage Warehouse and Service Point
+ */
+ public void setM_Warehouse_ID(int M_Warehouse_ID) {
+ if (M_Warehouse_ID < 1)
+ set_Value(COLUMNNAME_M_Warehouse_ID, null);
+ else
+ set_Value(COLUMNNAME_M_Warehouse_ID,
+ Integer.valueOf(M_Warehouse_ID));
+ }
+
+ /**
+ * Get Warehouse.
+ *
+ * @return Storage Warehouse and Service Point
+ */
+ public int getM_Warehouse_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_M_Warehouse_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- /** Set Posted.
- @param Posted
- Posting status
- */
- public void setPosted (boolean Posted)
- {
- set_Value (COLUMNNAME_Posted, Boolean.valueOf(Posted));
+ /**
+ * Set Posted.
+ *
+ * @param Posted
+ * Posting status
+ */
+ public void setPosted(boolean Posted) {
+ set_Value(COLUMNNAME_Posted, Boolean.valueOf(Posted));
}
- /** Get Posted.
- @return Posting status
- */
- public boolean isPosted ()
- {
+ /**
+ * Get Posted.
+ *
+ * @return Posting status
+ */
+ public boolean isPosted() {
Object oo = get_Value(COLUMNNAME_Posted);
- if (oo != null)
- {
- if (oo instanceof Boolean)
- return ((Boolean)oo).booleanValue();
+ if (oo != null) {
+ if (oo instanceof Boolean)
+ return ((Boolean) oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
- /** Set Processed.
- @param Processed
- The document has been processed
- */
- public void setProcessed (boolean Processed)
- {
- set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
+ /**
+ * Set Processed.
+ *
+ * @param Processed
+ * The document has been processed
+ */
+ public void setProcessed(boolean Processed) {
+ set_Value(COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
- /** Get Processed.
- @return The document has been processed
- */
- public boolean isProcessed ()
- {
+ /**
+ * Get Processed.
+ *
+ * @return The document has been processed
+ */
+ public boolean isProcessed() {
Object oo = get_Value(COLUMNNAME_Processed);
- if (oo != null)
- {
- if (oo instanceof Boolean)
- return ((Boolean)oo).booleanValue();
+ if (oo != null) {
+ if (oo instanceof Boolean)
+ return ((Boolean) oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
- /** Set Processed On.
- @param ProcessedOn
- The date+time (expressed in decimal format) when the document has been processed
- */
- public void setProcessedOn (BigDecimal ProcessedOn)
- {
- set_Value (COLUMNNAME_ProcessedOn, ProcessedOn);
+ /**
+ * Set Processed On.
+ *
+ * @param ProcessedOn
+ * The date+time (expressed in decimal format) when the document
+ * has been processed
+ */
+ public void setProcessedOn(BigDecimal ProcessedOn) {
+ set_Value(COLUMNNAME_ProcessedOn, ProcessedOn);
}
- /** Get Processed On.
- @return The date+time (expressed in decimal format) when the document has been processed
- */
- public BigDecimal getProcessedOn ()
- {
- BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ProcessedOn);
+ /**
+ * Get Processed On.
+ *
+ * @return The date+time (expressed in decimal format) when the document has
+ * been processed
+ */
+ public BigDecimal getProcessedOn() {
+ BigDecimal bd = (BigDecimal) get_Value(COLUMNNAME_ProcessedOn);
if (bd == null)
- return Env.ZERO;
+ return Env.ZERO;
return bd;
}
- /** Set Process Now.
- @param Processing Process Now */
- public void setProcessing (boolean Processing)
- {
- set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
+ /**
+ * Set Process Now.
+ *
+ * @param Processing
+ * Process Now
+ */
+ public void setProcessing(boolean Processing) {
+ set_Value(COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
- /** Get Process Now.
- @return Process Now */
- public boolean isProcessing ()
- {
+ /**
+ * Get Process Now.
+ *
+ * @return Process Now
+ */
+ public boolean isProcessing() {
Object oo = get_Value(COLUMNNAME_Processing);
- if (oo != null)
- {
- if (oo instanceof Boolean)
- return ((Boolean)oo).booleanValue();
+ if (oo != null) {
+ if (oo instanceof Boolean)
+ return ((Boolean) oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
- public org.compiere.model.I_M_Inventory getReversal() throws RuntimeException
- {
- return (org.compiere.model.I_M_Inventory)MTable.get(getCtx(), org.compiere.model.I_M_Inventory.Table_Name)
- .getPO(getReversal_ID(), get_TrxName()); }
-
- /** Set Reversal ID.
- @param Reversal_ID
- ID of document reversal
- */
- public void setReversal_ID (int Reversal_ID)
- {
- if (Reversal_ID < 1)
- set_Value (COLUMNNAME_Reversal_ID, null);
- else
- set_Value (COLUMNNAME_Reversal_ID, Integer.valueOf(Reversal_ID));
+ public org.compiere.model.I_M_Inventory getReversal()
+ throws RuntimeException {
+ return (org.compiere.model.I_M_Inventory) MTable.get(getCtx(),
+ org.compiere.model.I_M_Inventory.Table_Name).getPO(
+ getReversal_ID(), get_TrxName());
}
- /** Get Reversal ID.
- @return ID of document reversal
- */
- public int getReversal_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_Reversal_ID);
+ /**
+ * Set Reversal ID.
+ *
+ * @param Reversal_ID
+ * ID of document reversal
+ */
+ public void setReversal_ID(int Reversal_ID) {
+ if (Reversal_ID < 1)
+ set_Value(COLUMNNAME_Reversal_ID, null);
+ else
+ set_Value(COLUMNNAME_Reversal_ID, Integer.valueOf(Reversal_ID));
+ }
+
+ /**
+ * Get Reversal ID.
+ *
+ * @return ID of document reversal
+ */
+ public int getReversal_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_Reversal_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- /** Set Update Quantities.
- @param UpdateQty Update Quantities */
- public void setUpdateQty (String UpdateQty)
- {
- set_Value (COLUMNNAME_UpdateQty, UpdateQty);
+ /**
+ * Set Update Quantities.
+ *
+ * @param UpdateQty
+ * Update Quantities
+ */
+ public void setUpdateQty(String UpdateQty) {
+ set_Value(COLUMNNAME_UpdateQty, UpdateQty);
}
- /** Get Update Quantities.
- @return Update Quantities */
- public String getUpdateQty ()
- {
- return (String)get_Value(COLUMNNAME_UpdateQty);
+ /**
+ * Get Update Quantities.
+ *
+ * @return Update Quantities
+ */
+ public String getUpdateQty() {
+ return (String) get_Value(COLUMNNAME_UpdateQty);
}
- public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException
- {
- return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
- .getPO(getUser1_ID(), get_TrxName()); }
-
- /** Set User Element List 1.
- @param User1_ID
- User defined list element #1
- */
- public void setUser1_ID (int User1_ID)
- {
- if (User1_ID < 1)
- set_Value (COLUMNNAME_User1_ID, null);
- else
- set_Value (COLUMNNAME_User1_ID, Integer.valueOf(User1_ID));
+ public org.compiere.model.I_C_ElementValue getUser1()
+ throws RuntimeException {
+ return (org.compiere.model.I_C_ElementValue) MTable.get(getCtx(),
+ org.compiere.model.I_C_ElementValue.Table_Name).getPO(
+ getUser1_ID(), get_TrxName());
}
- /** Get User Element List 1.
- @return User defined list element #1
- */
- public int getUser1_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_User1_ID);
+ /**
+ * Set User Element List 1.
+ *
+ * @param User1_ID
+ * User defined list element #1
+ */
+ public void setUser1_ID(int User1_ID) {
+ if (User1_ID < 1)
+ set_Value(COLUMNNAME_User1_ID, null);
+ else
+ set_Value(COLUMNNAME_User1_ID, Integer.valueOf(User1_ID));
+ }
+
+ /**
+ * Get User Element List 1.
+ *
+ * @return User defined list element #1
+ */
+ public int getUser1_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_User1_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
- public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException
- {
- return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
- .getPO(getUser2_ID(), get_TrxName()); }
-
- /** Set User Element List 2.
- @param User2_ID
- User defined list element #2
- */
- public void setUser2_ID (int User2_ID)
- {
- if (User2_ID < 1)
- set_Value (COLUMNNAME_User2_ID, null);
- else
- set_Value (COLUMNNAME_User2_ID, Integer.valueOf(User2_ID));
+ public org.compiere.model.I_C_ElementValue getUser2()
+ throws RuntimeException {
+ return (org.compiere.model.I_C_ElementValue) MTable.get(getCtx(),
+ org.compiere.model.I_C_ElementValue.Table_Name).getPO(
+ getUser2_ID(), get_TrxName());
}
- /** Get User Element List 2.
- @return User defined list element #2
- */
- public int getUser2_ID ()
- {
- Integer ii = (Integer)get_Value(COLUMNNAME_User2_ID);
+ /**
+ * Set User Element List 2.
+ *
+ * @param User2_ID
+ * User defined list element #2
+ */
+ public void setUser2_ID(int User2_ID) {
+ if (User2_ID < 1)
+ set_Value(COLUMNNAME_User2_ID, null);
+ else
+ set_Value(COLUMNNAME_User2_ID, Integer.valueOf(User2_ID));
+ }
+
+ /**
+ * Get User Element List 2.
+ *
+ * @return User defined list element #2
+ */
+ public int getUser2_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_User2_ID);
if (ii == null)
- return 0;
+ return 0;
return ii.intValue();
}
+
+ public org.compiere.model.I_C_Currency getC_Currency()
+ throws RuntimeException {
+ return (org.compiere.model.I_C_Currency) MTable.get(getCtx(),
+ org.compiere.model.I_C_Currency.Table_Name).getPO(
+ getC_Currency_ID(), get_TrxName());
+ }
+
+ /**
+ * Set Currency.
+ *
+ * @param C_Currency_ID
+ * The Currency for this record
+ */
+ public void setC_Currency_ID(int C_Currency_ID) {
+ if (C_Currency_ID < 1)
+ set_ValueNoCheck(COLUMNNAME_C_Currency_ID, null);
+ else
+ set_ValueNoCheck(COLUMNNAME_C_Currency_ID,
+ Integer.valueOf(C_Currency_ID));
+ }
+
+ /**
+ * Get Currency.
+ *
+ * @return The Currency for this record
+ */
+ public int getC_Currency_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_C_Currency_ID);
+ if (ii == null)
+ return 0;
+ return ii.intValue();
+ }
+
+ public org.compiere.model.I_C_ConversionType getC_ConversionType()
+ throws RuntimeException {
+ return (org.compiere.model.I_C_ConversionType) MTable.get(getCtx(),
+ org.compiere.model.I_C_ConversionType.Table_Name).getPO(
+ getC_ConversionType_ID(), get_TrxName());
+ }
+
+ /**
+ * Set Currency Type.
+ *
+ * @param C_ConversionType_ID
+ * Currency Conversion Rate Type
+ */
+ public void setC_ConversionType_ID(int C_ConversionType_ID) {
+ if (C_ConversionType_ID < 1)
+ set_Value(COLUMNNAME_C_ConversionType_ID, null);
+ else
+ set_Value(COLUMNNAME_C_ConversionType_ID,
+ Integer.valueOf(C_ConversionType_ID));
+ }
+
+ /**
+ * Get Currency Type.
+ *
+ * @return Currency Conversion Rate Type
+ */
+ public int getC_ConversionType_ID() {
+ Integer ii = (Integer) get_Value(COLUMNNAME_C_ConversionType_ID);
+ if (ii == null)
+ return 0;
+ return ii.intValue();
+ }
+
}
\ No newline at end of file
diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java
index 534d14593f..58d1f7eed7 100644
--- a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java
+++ b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java
@@ -101,6 +101,7 @@ import org.compiere.model.GridWorkbench;
import org.compiere.model.Lookup;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MProcess;
+import org.compiere.model.MProjectIssue;
import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MToolBarButtonRestrict;
@@ -2754,7 +2755,8 @@ public final class APanel extends CPanel
if (DocAction.STATUS_Completed.equals(docStatus)
|| DocAction.STATUS_Closed.equals(docStatus)
|| DocAction.STATUS_Reversed.equals(docStatus)
- || DocAction.STATUS_Voided.equals(docStatus))
+ || DocAction.STATUS_Voided.equals(docStatus)
+ || table_ID == MProjectIssue.Table_ID) // document without status
;
else
{
diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml
index e138fad282..28e084a7db 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml
+++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml
@@ -39,6 +39,7 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI).
++
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java
index 933d77b5b6..b341eac355 100755
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java
@@ -531,7 +531,7 @@ public class WAcctViewer extends Window implements EventListener
ZKUpdateUtil.setHflex(table, "1");
ZKUpdateUtil.setVflex(table, true);
//ZKUpdateUtil.setHeight(table, "99%");
- table.setStyle("position: absolute;");
+ //table.setStyle("position: absolute;");
resultCenter.appendChild(table);
ZKUpdateUtil.setHflex(table, "1");
//ZKUpdateUtil.setVflex(table, "1");
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindow.java
index 0ead498d12..22dca8ae37 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindow.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindow.java
@@ -219,7 +219,11 @@ public class ADWindow extends AbstractUIPart
* @return adwindow instance for windowNo ( if any )
*/
public static ADWindow get(int windowNo) {
- return (ADWindow) SessionManager.getAppDesktop().findWindow(windowNo);
+ Object window = SessionManager.getAppDesktop().findWindow(windowNo);
+ if (window != null && window instanceof ADWindow)
+ return (ADWindow) SessionManager.getAppDesktop().findWindow(windowNo);
+
+ return null;
}
/**
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java
index 979bae9f83..9ff899c96c 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java
@@ -87,6 +87,7 @@ import org.compiere.model.GridWindowVO;
import org.compiere.model.I_M_Product;
import org.compiere.model.MImage;
import org.compiere.model.MProcess;
+import org.compiere.model.MProjectIssue;
import org.compiere.model.MQuery;
import org.compiere.model.MRecentItem;
import org.compiere.model.MRole;
@@ -2821,7 +2822,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (DocAction.STATUS_Completed.equals(docStatus)
|| DocAction.STATUS_Closed.equals(docStatus)
|| DocAction.STATUS_Reversed.equals(docStatus)
- || DocAction.STATUS_Voided.equals(docStatus))
+ || DocAction.STATUS_Voided.equals(docStatus)
+ || table_ID == MProjectIssue.Table_ID) // document without status
;
else
{
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java
index d11d81c5b5..a5f49159bb 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java
@@ -789,7 +789,7 @@ public class CompositeADTabbox extends AbstractADTabbox
}
headerTab.getDetailPane().onEdit(getSelectedDetailADTabpanel().getGridTab().isSingleRow());
} catch (Exception e) {
- log.log(Level.SEVERE, e.getLocalizedMessage(), e);
+ throw new RuntimeException(e);
}
}
}
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java
index 67930b3088..3cb83db25e 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java
@@ -72,6 +72,10 @@ public class WStringEditor extends WEditor implements ContextMenuListener
{
super(gridField.isAutocomplete() ? new Combobox() : new Textbox(), gridField);
this.tableEditor = tableEditor;
+
+ if (gridField.getVFormat() != null && !gridField.getVFormat().isEmpty())
+ getComponent().setWidgetListener("onBind", "jq(this).mask('" + gridField.getVFormat() + "');");
+
init(gridField.getObscureType());
}
@@ -83,14 +87,17 @@ public class WStringEditor extends WEditor implements ContextMenuListener
* @param isUpdateable
* @param displayLength
* @param fieldLength
- * @param vFormat
+ * @param wVFormat
* @param obscureType
*/
public WStringEditor(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable,
- int displayLength, int fieldLength, String vFormat, String obscureType)
+ int displayLength, int fieldLength, String wVFormat, String obscureType)
{
super(new Textbox(), columnName, null, null, mandatory, isReadOnly,isUpdateable);
+ if (wVFormat != null && !wVFormat.isEmpty())
+ getComponent().setWidgetListener("onBind", "jq(this).mask('" + wVFormat + "');");
+
init(obscureType);
}
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java
index 80055622ee..f737961748 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java
@@ -1649,6 +1649,13 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
dynamicDisplay(null);
onQueryCallback (null);
+
+ if (paging != null)
+ paging.setParent(null);
+
+ layout.invalidate();
+
+ contentPanel.getListHead().detach();
}
@Override
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java
index 5fbdaf8f61..795243d48b 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java
@@ -734,7 +734,6 @@ public abstract class InfoPanel extends Window implements EventListener,
paging.setTotalSize(m_count);
paging.setDetailed(true);
paging.addEventListener(ZulEvents.ON_PAGING, this);
- insertPagingComponent();
}
else
{
@@ -783,6 +782,9 @@ public abstract class InfoPanel extends Window implements EventListener,
updateStatusBar (m_count);
setStatusSelected ();
addDoubleClickListener();
+
+ if (paging != null && paging.getParent() == null)
+ insertPagingComponent();
}
protected void updateStatusBar (int no){
diff --git a/org.adempiere.ui.zk/js/jquery.maskedinput.js b/org.adempiere.ui.zk/js/jquery.maskedinput.js
new file mode 100644
index 0000000000..58c1174ae3
--- /dev/null
+++ b/org.adempiere.ui.zk/js/jquery.maskedinput.js
@@ -0,0 +1,191 @@
+/*
+ jQuery Masked Input Plugin
+ Copyright (c) 2007 - 2015 Josh Bush (digitalbush.com)
+ Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
+ Version: 1.4.1
+*/
+!function(factory) {
+ "function" == typeof define && define.amd ? define([ "jquery" ], factory) : factory("object" == typeof exports ? require("jquery") : jQuery);
+}(function($) {
+ var caretTimeoutId, ua = navigator.userAgent, iPhone = /iphone/i.test(ua), chrome = /chrome/i.test(ua), android = /android/i.test(ua);
+ $.mask = {
+ definitions: {
+ /* iDempiere VFormat */
+ "0":"[0-9]",
+ "9":"[ 0-9]",
+ a:"[A-Za-z0-9]",
+ A:"[A-Z0-9]",
+ c:"[ A-Za-z0-9]",
+ C:"[ A-Z0-9]",
+ l:"[A-Za-z]",
+ L:"[A-Z]",
+ o:"[ A-Za-z]",
+ O:"[ A-Z]",
+ U:"[^a-z]" /* adding a new iDempiere format to allow any character except lowercases - useful to force company names in uppercase */
+ },
+ autoclear: !0,
+ dataName: "rawMaskFn",
+ placeholder: " "
+ }, $.fn.extend({
+ caret: function(begin, end) {
+ var range;
+ if (0 !== this.length && !this.is(":hidden")) return "number" == typeof begin ? (end = "number" == typeof end ? end : begin,
+ this.each(function() {
+ this.setSelectionRange ? this.setSelectionRange(begin, end) : this.createTextRange && (range = this.createTextRange(),
+ range.collapse(!0), range.moveEnd("character", end), range.moveStart("character", begin),
+ range.select());
+ })) : (this[0].setSelectionRange ? (begin = this[0].selectionStart, end = this[0].selectionEnd) : document.selection && document.selection.createRange && (range = document.selection.createRange(),
+ begin = 0 - range.duplicate().moveStart("character", -1e5), end = begin + range.text.length),
+ {
+ begin: begin,
+ end: end
+ });
+ },
+ unmask: function() {
+ return this.trigger("unmask");
+ },
+ mask: function(mask, settings) {
+ var input, defs, tests, partialPosition, firstNonMaskPos, lastRequiredNonMaskPos, len, oldVal;
+ if (!mask && this.length > 0) {
+ input = $(this[0]);
+ var fn = input.data($.mask.dataName);
+ return fn ? fn() : void 0;
+ }
+ return settings = $.extend({
+ autoclear: $.mask.autoclear,
+ placeholder: $.mask.placeholder,
+ completed: null
+ }, settings), defs = $.mask.definitions, tests = [], partialPosition = len = mask.length,
+ firstNonMaskPos = null, $.each(mask.split(""), function(i, c) {
+ "?" == c ? (len--, partialPosition = i) : defs[c] ? (tests.push(new RegExp(defs[c])),
+ null === firstNonMaskPos && (firstNonMaskPos = tests.length - 1), partialPosition > i && (lastRequiredNonMaskPos = tests.length - 1)) : tests.push(null);
+ }), this.trigger("unmask").each(function() {
+ function tryFireCompleted() {
+ if (settings.completed) {
+ for (var i = firstNonMaskPos; lastRequiredNonMaskPos >= i; i++) if (tests[i] && buffer[i] === getPlaceholder(i)) return;
+ settings.completed.call(input);
+ }
+ }
+ function getPlaceholder(i) {
+ return settings.placeholder.charAt(i < settings.placeholder.length ? i : 0);
+ }
+ function seekNext(pos) {
+ for (;++pos < len && !tests[pos]; ) ;
+ return pos;
+ }
+ function seekPrev(pos) {
+ for (;--pos >= 0 && !tests[pos]; ) ;
+ return pos;
+ }
+ function shiftL(begin, end) {
+ var i, j;
+ if (!(0 > begin)) {
+ for (i = begin, j = seekNext(end); len > i; i++) if (tests[i]) {
+ if (!(len > j && tests[i].test(buffer[j]))) break;
+ buffer[i] = buffer[j], buffer[j] = getPlaceholder(j), j = seekNext(j);
+ }
+ writeBuffer(), input.caret(Math.max(firstNonMaskPos, begin));
+ }
+ }
+ function shiftR(pos) {
+ var i, c, j, t;
+ for (i = pos, c = getPlaceholder(pos); len > i; i++) if (tests[i]) {
+ if (j = seekNext(i), t = buffer[i], buffer[i] = c, !(len > j && tests[j].test(t))) break;
+ c = t;
+ }
+ }
+ function androidInputEvent() {
+ var curVal = input.val(), pos = input.caret();
+ if (oldVal && oldVal.length && oldVal.length > curVal.length) {
+ for (checkVal(!0); pos.begin > 0 && !tests[pos.begin - 1]; ) pos.begin--;
+ if (0 === pos.begin) for (;pos.begin < firstNonMaskPos && !tests[pos.begin]; ) pos.begin++;
+ input.caret(pos.begin, pos.begin);
+ } else {
+ for (checkVal(!0); pos.begin < len && !tests[pos.begin]; ) pos.begin++;
+ input.caret(pos.begin, pos.begin);
+ }
+ tryFireCompleted();
+ }
+ function blurEvent() {
+ checkVal(), input.val() != focusText && input.change();
+ }
+ function keydownEvent(e) {
+ if (!input.prop("readonly")) {
+ var pos, begin, end, k = e.which || e.keyCode;
+ oldVal = input.val(), 8 === k || 46 === k || iPhone && 127 === k ? (pos = input.caret(),
+ begin = pos.begin, end = pos.end, end - begin === 0 && (begin = 46 !== k ? seekPrev(begin) : end = seekNext(begin - 1),
+ end = 46 === k ? seekNext(end) : end), clearBuffer(begin, end), shiftL(begin, end - 1),
+ e.preventDefault()) : 13 === k ? blurEvent.call(this, e) : 27 === k && (input.val(focusText),
+ input.caret(0, checkVal()), e.preventDefault());
+ }
+ }
+ function keypressEvent(e) {
+ if (!input.prop("readonly")) {
+ var p, c, next, k = e.which || e.keyCode, pos = input.caret();
+ if (!(e.ctrlKey || e.altKey || e.metaKey || 32 > k) && k && 13 !== k) {
+ if (pos.end - pos.begin !== 0 && (clearBuffer(pos.begin, pos.end), shiftL(pos.begin, pos.end - 1)),
+ p = seekNext(pos.begin - 1), len > p && (c = String.fromCharCode(k), tests[p].test(c))) {
+ if (shiftR(p), buffer[p] = c, writeBuffer(), next = seekNext(p), android) {
+ var proxy = function() {
+ $.proxy($.fn.caret, input, next)();
+ };
+ setTimeout(proxy, 0);
+ } else input.caret(next);
+ pos.begin <= lastRequiredNonMaskPos && tryFireCompleted();
+ }
+ e.preventDefault();
+ }
+ }
+ }
+ function clearBuffer(start, end) {
+ var i;
+ for (i = start; end > i && len > i; i++) tests[i] && (buffer[i] = getPlaceholder(i));
+ }
+ function writeBuffer() {
+ input.val(buffer.join(""));
+ }
+ function checkVal(allow) {
+ var i, c, pos, test = input.val(), lastMatch = -1;
+ for (i = 0, pos = 0; len > i; i++) if (tests[i]) {
+ for (buffer[i] = getPlaceholder(i); pos++ < test.length; ) if (c = test.charAt(pos - 1),
+ tests[i].test(c)) {
+ buffer[i] = c, lastMatch = i;
+ break;
+ }
+ if (pos > test.length) {
+ clearBuffer(i + 1, len);
+ break;
+ }
+ } else buffer[i] === test.charAt(pos) && pos++, partialPosition > i && (lastMatch = i);
+ return allow ? writeBuffer() : partialPosition > lastMatch + 1 ? settings.autoclear || buffer.join("") === defaultBuffer ? (input.val() && input.val(""),
+ clearBuffer(0, len)) : writeBuffer() : (writeBuffer(), input.val(input.val().substring(0, lastMatch + 1))),
+ partialPosition ? i : firstNonMaskPos;
+ }
+ var input = $(this), buffer = $.map(mask.split(""), function(c, i) {
+ return "?" != c ? defs[c] ? getPlaceholder(i) : c : void 0;
+ }), defaultBuffer = buffer.join(""), focusText = input.val();
+ input.data($.mask.dataName, function() {
+ return $.map(buffer, function(c, i) {
+ return tests[i] && c != getPlaceholder(i) ? c : null;
+ }).join("");
+ }), input.one("unmask", function() {
+ input.off(".mask").removeData($.mask.dataName);
+ }).on("focus.mask", function() {
+ if (!input.prop("readonly")) {
+ clearTimeout(caretTimeoutId);
+ var pos;
+ focusText = input.val(), pos = checkVal(), caretTimeoutId = setTimeout(function() {
+ input.get(0) === document.activeElement && (writeBuffer(), pos == mask.replace("?", "").length ? input.caret(0, pos) : input.caret(pos));
+ }, 10);
+ }
+ }).on("blur.mask", blurEvent).on("keydown.mask", keydownEvent).on("keypress.mask", keypressEvent).on("input.mask paste.mask", function() {
+ input.prop("readonly") || setTimeout(function() {
+ var pos = checkVal(!0);
+ input.caret(pos), tryFireCompleted();
+ }, 0);
+ }), chrome && android && input.off("input.mask").on("input.mask", androidInputEvent),
+ checkVal();
+ });
+ }
+ });
+});