hg merge release-3.1 (merge release3.1 into development)

This commit is contained in:
Carlos Ruiz 2016-05-17 11:51:49 -07:00
commit 92a26c573f
42 changed files with 2012 additions and 556 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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"','<B>Validation elements:</B>
(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"','<B>Validation elements:</B>
(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"','<B>Validation elements:</B>
(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"','<B>Validation elements:</B>
(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
;

View File

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

View File

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

View File

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

View File

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

View File

@ -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"','<B>Validation elements:</B>
(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"','<B>Validation elements:</B>
(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"','<B>Validation elements:</B>
(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"','<B>Validation elements:</B>
(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
;

View File

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

View File

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

View File

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

View File

@ -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<X_C_ContactActivity> 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);

View File

@ -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();

View File

@ -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(),

View File

@ -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();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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();
}
/*************************************************************************/

View File

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

View File

@ -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());

View File

@ -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(".")

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -39,6 +39,7 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI).
<javascript src="/js/token.js" charset="UTF-8"/>
<javascript src="/js/window.js" charset="UTF-8"/>
<javascript src="/js/html2canvas.js" charset="UTF-8"/>
+ <javascript src="/js/jquery.maskedinput.js" charset="UTF-8"/>
<javascript package="jawwa.atmosphere" merge="false" />

View File

@ -531,7 +531,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
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");

View File

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

View File

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

View File

@ -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);
}
}
}

View File

@ -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);
}

View File

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

View File

@ -734,7 +734,6 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
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<Event>,
updateStatusBar (m_count);
setStatusSelected ();
addDoubleClickListener();
if (paging != null && paging.getParent() == null)
insertPagingComponent();
}
protected void updateStatusBar (int no){

View File

@ -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();
});
}
});
});