From b449ccf1dbab8c9f5ad043ea187e16378c2a1479 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 Mar 2012 16:07:19 -0500 Subject: [PATCH 1/9] IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge http://jira.idempiere.com/browse/IDEMPIERE-178 --- .../oracle/823_IDEMPIERE-178.sql | 84 +++++++++++++++++++ .../postgresql/823_IDEMPIERE-178.sql | 84 +++++++++++++++++++ .../src/org/compiere/model/I_C_DocType.java | 36 ++++++-- .../src/org/compiere/model/MInOutLine.java | 10 +++ .../src/org/compiere/model/MInvoiceLine.java | 11 +++ .../src/org/compiere/model/MOrderLine.java | 10 +++ .../org/compiere/model/MRequisitionLine.java | 11 +++ .../src/org/compiere/model/X_C_DocType.java | 69 +++++++++++---- 8 files changed, 289 insertions(+), 26 deletions(-) create mode 100644 migration/360lts-release/oracle/823_IDEMPIERE-178.sql create mode 100644 migration/360lts-release/postgresql/823_IDEMPIERE-178.sql diff --git a/migration/360lts-release/oracle/823_IDEMPIERE-178.sql b/migration/360lts-release/oracle/823_IDEMPIERE-178.sql new file mode 100644 index 0000000000..ef6f5031e5 --- /dev/null +++ b/migration/360lts-release/oracle/823_IDEMPIERE-178.sql @@ -0,0 +1,84 @@ +-- Mar 7, 2012 2:02:28 PM COT +-- IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200004,'IsChargeOrProductMandatory','D','Mandatory Charge or Product','Mandatory Charge or Product',0,TO_DATE('2012-03-07 14:02:26','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-03-07 14:02:26','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Mar 7, 2012 2:02:28 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_PrintName,PO_Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_PrintName,t.PO_Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200004 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Mar 7, 2012 2:02:39 PM COT +UPDATE AD_Element_Trl SET IsTranslated='Y',Name='Cargo o Producto Obligatorio',PrintName='Cargo o Producto Obligatorio',Updated=TO_DATE('2012-03-07 14:02:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200004 AND AD_Language LIKE 'es_%' +; + +-- Mar 7, 2012 2:03:42 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('N',200019,217,'D',0,'N','N','N',0,'N',1,'N',20,'N','N',200004,'N','Y','N','Y','N','IsChargeOrProductMandatory','Mandatory Charge or Product','Y',100,TO_DATE('2012-03-07 14:03:41','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-03-07 14:03:41','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Mar 7, 2012 2:03:42 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200019 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Mar 7, 2012 2:03:46 PM COT +ALTER TABLE C_DocType ADD IsChargeOrProductMandatory CHAR(1) DEFAULT 'N' CHECK (IsChargeOrProductMandatory IN ('Y','N')) +; + +-- Mar 7, 2012 2:04:54 PM COT +INSERT INTO AD_Field (SortNo,IsEncrypted,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Tab_ID,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,'N',10,'Y','N','N',200019,'N',320,'Y',167,200004,'N','D','Mandatory Charge or Product',100,0,'Y',TO_DATE('2012-03-07 14:04:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-03-07 14:04:53','YYYY-MM-DD HH24:MI:SS')) +; + +-- Mar 7, 2012 2:04:54 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200004 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Mar 7, 2012 2:07:03 PM COT +UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=200004 +; + +-- Mar 7, 2012 2:07:04 PM COT +UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=6567 +; + +-- Mar 7, 2012 2:07:04 PM COT +UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=3125 +; + +-- Mar 7, 2012 2:11:22 PM COT +UPDATE AD_Field SET DisplayLogic='@DocBaseType@=''SOO'' | @DocBaseType@=''POO'' | @DocBaseType@=''MMR'' | @DocBaseType@=''MMS'' | @DocBaseType@=''API'' | @DocBaseType@=''APC'' | @DocBaseType@=''ARI'' | @DocBaseType@=''ARC'' | @DocBaseType@=''POR''',Updated=TO_DATE('2012-03-07 14:11:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200004 +; + +-- Mar 7, 2012 2:13:33 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@M_Product_ID@!0',Updated=TO_DATE('2012-03-07 14:13:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3050 +; + +-- Mar 7, 2012 2:14:15 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@M_Product_ID@!0',Updated=TO_DATE('2012-03-07 14:14:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13434 +; + +-- Mar 7, 2012 2:14:30 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@C_Charge_ID@!0',Updated=TO_DATE('2012-03-07 14:14:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3539 +; + +-- Mar 7, 2012 2:15:04 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@M_Product_ID@!0', Updated=TO_DATE('2012-03-07 14:15:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15010 +; + +-- Mar 7, 2012 2:15:19 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@C_Charge_ID@!0',Updated=TO_DATE('2012-03-07 14:15:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11501 +; + +-- Mar 7, 2012 3:18:35 PM COT +-- IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,Value,IsActive,Updated,AD_Client_ID,AD_Org_ID,CreatedBy,Created,UpdatedBy) VALUES ('I','On this document is mandatory to fill the product or the charge',200003,'D','ChargeOrProductMandatory','Y',TO_DATE('2012-03-07 15:18:34','YYYY-MM-DD HH24:MI:SS'),0,0,100,TO_DATE('2012-03-07 15:18:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Mar 7, 2012 3:18:35 PM COT +-- IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200003 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Mar 7, 2012 3:18:43 PM COT +-- IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge +UPDATE AD_Message_Trl SET IsTranslated='Y',MsgText='En este documento se debe diligenciar el cargo o el producto',Updated=TO_DATE('2012-03-07 15:18:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200003 AND AD_Language LIKE 'es_%' +; + diff --git a/migration/360lts-release/postgresql/823_IDEMPIERE-178.sql b/migration/360lts-release/postgresql/823_IDEMPIERE-178.sql new file mode 100644 index 0000000000..b1e1aede6a --- /dev/null +++ b/migration/360lts-release/postgresql/823_IDEMPIERE-178.sql @@ -0,0 +1,84 @@ +-- Mar 7, 2012 2:02:28 PM COT +-- IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge +INSERT INTO AD_Element (AD_Element_ID,ColumnName,EntityType,Name,PrintName,AD_Client_ID,Created,Updated,IsActive,AD_Org_ID,CreatedBy,UpdatedBy) VALUES (200004,'IsChargeOrProductMandatory','D','Mandatory Charge or Product','Mandatory Charge or Product',0,TO_TIMESTAMP('2012-03-07 14:02:26','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-03-07 14:02:26','YYYY-MM-DD HH24:MI:SS'),'Y',0,100,100) +; + +-- Mar 7, 2012 2:02:28 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_PrintName,PO_Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_PrintName,t.PO_Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200004 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Mar 7, 2012 2:02:39 PM COT +UPDATE AD_Element_Trl SET IsTranslated='Y',Name='Cargo o Producto Obligatorio',PrintName='Cargo o Producto Obligatorio',Updated=TO_TIMESTAMP('2012-03-07 14:02:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=200004 AND AD_Language LIKE 'es_%' +; + +-- Mar 7, 2012 2:03:42 PM COT +INSERT INTO AD_Column (DefaultValue,AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES ('N',200019,217,'D',0,'N','N','N',0,'N',1,'N',20,'N','N',200004,'N','Y','N','Y','N','IsChargeOrProductMandatory','Mandatory Charge or Product','Y',100,TO_TIMESTAMP('2012-03-07 14:03:41','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-03-07 14:03:41','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Mar 7, 2012 2:03:42 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200019 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Mar 7, 2012 2:03:46 PM COT +ALTER TABLE C_DocType ADD COLUMN IsChargeOrProductMandatory CHAR(1) DEFAULT 'N' CHECK (IsChargeOrProductMandatory IN ('Y','N')) +; + +-- Mar 7, 2012 2:04:54 PM COT +INSERT INTO AD_Field (SortNo,IsEncrypted,DisplayLength,IsDisplayed,IsSameLine,IsHeading,AD_Column_ID,IsFieldOnly,SeqNo,IsCentrallyMaintained,AD_Tab_ID,AD_Field_ID,IsReadOnly,EntityType,Name,UpdatedBy,AD_Org_ID,IsActive,Created,AD_Client_ID,CreatedBy,Updated) VALUES (0,'N',10,'Y','N','N',200019,'N',320,'Y',167,200004,'N','D','Mandatory Charge or Product',100,0,'Y',TO_TIMESTAMP('2012-03-07 14:04:53','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-03-07 14:04:53','YYYY-MM-DD HH24:MI:SS')) +; + +-- Mar 7, 2012 2:04:54 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200004 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Mar 7, 2012 2:07:03 PM COT +UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=200004 +; + +-- Mar 7, 2012 2:07:04 PM COT +UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=6567 +; + +-- Mar 7, 2012 2:07:04 PM COT +UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=3125 +; + +-- Mar 7, 2012 2:11:22 PM COT +UPDATE AD_Field SET DisplayLogic='@DocBaseType@=''SOO'' | @DocBaseType@=''POO'' | @DocBaseType@=''MMR'' | @DocBaseType@=''MMS'' | @DocBaseType@=''API'' | @DocBaseType@=''APC'' | @DocBaseType@=''ARI'' | @DocBaseType@=''ARC'' | @DocBaseType@=''POR''',Updated=TO_TIMESTAMP('2012-03-07 14:11:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200004 +; + +-- Mar 7, 2012 2:13:33 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@M_Product_ID@!0',Updated=TO_TIMESTAMP('2012-03-07 14:13:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3050 +; + +-- Mar 7, 2012 2:14:15 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@M_Product_ID@!0',Updated=TO_TIMESTAMP('2012-03-07 14:14:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13434 +; + +-- Mar 7, 2012 2:14:30 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@C_Charge_ID@!0',Updated=TO_TIMESTAMP('2012-03-07 14:14:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3539 +; + +-- Mar 7, 2012 2:15:04 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@M_Product_ID@!0', Updated=TO_TIMESTAMP('2012-03-07 14:15:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15010 +; + +-- Mar 7, 2012 2:15:19 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@C_Charge_ID@!0',Updated=TO_TIMESTAMP('2012-03-07 14:15:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=11501 +; + +-- Mar 7, 2012 3:18:35 PM COT +-- IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,Value,IsActive,Updated,AD_Client_ID,AD_Org_ID,CreatedBy,Created,UpdatedBy) VALUES ('I','On this document is mandatory to fill the product or the charge',200003,'D','ChargeOrProductMandatory','Y',TO_TIMESTAMP('2012-03-07 15:18:34','YYYY-MM-DD HH24:MI:SS'),0,0,100,TO_TIMESTAMP('2012-03-07 15:18:34','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Mar 7, 2012 3:18:35 PM COT +-- IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200003 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Mar 7, 2012 3:18:43 PM COT +-- IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge +UPDATE AD_Message_Trl SET IsTranslated='Y',MsgText='En este documento se debe diligenciar el cargo o el producto',Updated=TO_TIMESTAMP('2012-03-07 15:18:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200003 AND AD_Language LIKE 'es_%' +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_C_DocType.java b/org.adempiere.base/src/org/compiere/model/I_C_DocType.java index f0caaed939..1d71dc9028 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_DocType.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_DocType.java @@ -31,7 +31,7 @@ public interface I_C_DocType public static final String Table_Name = "C_DocType"; /** AD_Table_ID=217 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 217; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); @@ -75,7 +75,7 @@ public interface I_C_DocType */ public int getAD_PrintFormat_ID(); - public I_AD_PrintFormat getAD_PrintFormat() throws RuntimeException; + public org.compiere.model.I_AD_PrintFormat getAD_PrintFormat() throws RuntimeException; /** Column name C_DocTypeDifference_ID */ public static final String COLUMNNAME_C_DocTypeDifference_ID = "C_DocTypeDifference_ID"; @@ -90,7 +90,7 @@ public interface I_C_DocType */ public int getC_DocTypeDifference_ID(); - public I_C_DocType getC_DocTypeDifference() throws RuntimeException; + public org.compiere.model.I_C_DocType getC_DocTypeDifference() throws RuntimeException; /** Column name C_DocType_ID */ public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; @@ -118,7 +118,7 @@ public interface I_C_DocType */ public int getC_DocTypeInvoice_ID(); - public I_C_DocType getC_DocTypeInvoice() throws RuntimeException; + public org.compiere.model.I_C_DocType getC_DocTypeInvoice() throws RuntimeException; /** Column name C_DocTypeProforma_ID */ public static final String COLUMNNAME_C_DocTypeProforma_ID = "C_DocTypeProforma_ID"; @@ -133,7 +133,7 @@ public interface I_C_DocType */ public int getC_DocTypeProforma_ID(); - public I_C_DocType getC_DocTypeProforma() throws RuntimeException; + public org.compiere.model.I_C_DocType getC_DocTypeProforma() throws RuntimeException; /** Column name C_DocTypeShipment_ID */ public static final String COLUMNNAME_C_DocTypeShipment_ID = "C_DocTypeShipment_ID"; @@ -148,7 +148,16 @@ public interface I_C_DocType */ public int getC_DocTypeShipment_ID(); - public I_C_DocType getC_DocTypeShipment() throws RuntimeException; + public org.compiere.model.I_C_DocType getC_DocTypeShipment() throws RuntimeException; + + /** Column name C_DocType_UU */ + public static final String COLUMNNAME_C_DocType_UU = "C_DocType_UU"; + + /** Set C_DocType_UU */ + public void setC_DocType_UU (String C_DocType_UU); + + /** Get C_DocType_UU */ + public String getC_DocType_UU(); /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -175,7 +184,7 @@ public interface I_C_DocType /** Get Definite Sequence */ public int getDefiniteSequence_ID(); - public I_AD_Sequence getDefiniteSequence() throws RuntimeException; + public org.compiere.model.I_AD_Sequence getDefiniteSequence() throws RuntimeException; /** Column name Description */ public static final String COLUMNNAME_Description = "Description"; @@ -216,7 +225,7 @@ public interface I_C_DocType */ public int getDocNoSequence_ID(); - public I_AD_Sequence getDocNoSequence() throws RuntimeException; + public org.compiere.model.I_AD_Sequence getDocNoSequence() throws RuntimeException; /** Column name DocSubTypeSO */ public static final String COLUMNNAME_DocSubTypeSO = "DocSubTypeSO"; @@ -270,7 +279,7 @@ public interface I_C_DocType */ public int getGL_Category_ID(); - public I_GL_Category getGL_Category() throws RuntimeException; + public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException; /** Column name HasCharges */ public static final String COLUMNNAME_HasCharges = "HasCharges"; @@ -311,6 +320,15 @@ public interface I_C_DocType */ public boolean isActive(); + /** Column name IsChargeOrProductMandatory */ + public static final String COLUMNNAME_IsChargeOrProductMandatory = "IsChargeOrProductMandatory"; + + /** Set Mandatory Charge or Product */ + public void setIsChargeOrProductMandatory (boolean IsChargeOrProductMandatory); + + /** Get Mandatory Charge or Product */ + public boolean isChargeOrProductMandatory(); + /** Column name IsCreateCounter */ public static final String COLUMNNAME_IsCreateCounter = "IsCreateCounter"; diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLine.java b/org.adempiere.base/src/org/compiere/model/MInOutLine.java index 04e21e6903..8641f14542 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLine.java @@ -597,6 +597,16 @@ public class MInOutLine extends X_M_InOutLine } } /**/ + /* Carlos Ruiz - globalqss + * IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge + */ + if (getParent().getC_DocType().isChargeOrProductMandatory()) { + if (getC_Charge_ID() == 0 && getM_Product_ID() == 0) { + log.saveError("FillMandatory", Msg.translate(getCtx(), "ChargeOrProductMandatory")); + return false; + } + } + return true; } // beforeSave diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index fc9e730b8d..00a6226ebe 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -873,6 +873,17 @@ public class MInvoiceLine extends X_C_InvoiceLine if (m_IsSOTrx || getTaxAmt().compareTo(Env.ZERO) == 0) setTaxAmt(); // + + /* Carlos Ruiz - globalqss + * IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge + */ + if (getParent().getC_DocTypeTarget().isChargeOrProductMandatory()) { + if (getC_Charge_ID() == 0 && getM_Product_ID() == 0 && getPriceEntered().signum() != 0) { + log.saveError("FillMandatory", Msg.translate(getCtx(), "ChargeOrProductMandatory")); + return false; + } + } + return true; } // beforeSave diff --git a/org.adempiere.base/src/org/compiere/model/MOrderLine.java b/org.adempiere.base/src/org/compiere/model/MOrderLine.java index 36dcf9770b..0d88356e0a 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderLine.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderLine.java @@ -913,6 +913,16 @@ public class MOrderLine extends X_C_OrderLine setLineNetAmt(); // extended Amount with or without tax setDiscount(); + /* Carlos Ruiz - globalqss + * IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge + */ + if (getParent().getC_DocTypeTarget().isChargeOrProductMandatory()) { + if (getC_Charge_ID() == 0 && getM_Product_ID() == 0 && getPriceEntered().signum() != 0) { + log.saveError("FillMandatory", Msg.translate(getCtx(), "ChargeOrProductMandatory")); + return false; + } + } + return true; } // beforeSave diff --git a/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java b/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java index 29ef5384ce..368fc65b8e 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java @@ -282,6 +282,17 @@ public class MRequisitionLine extends X_M_RequisitionLine if (getPriceActual().signum() == 0) setPrice(); setLineNetAmt(); + + /* Carlos Ruiz - globalqss + * IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge + */ + if (getParent().getC_DocType().isChargeOrProductMandatory()) { + if (getC_Charge_ID() == 0 && getM_Product_ID() == 0 && getPriceActual().signum() != 0) { + log.saveError("FillMandatory", Msg.translate(getCtx(), "ChargeOrProductMandatory")); + return false; + } + } + return true; } // beforeSave diff --git a/org.adempiere.base/src/org/compiere/model/X_C_DocType.java b/org.adempiere.base/src/org/compiere/model/X_C_DocType.java index 7d76d15b3e..8bdee4923d 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_DocType.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_DocType.java @@ -30,7 +30,7 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent /** * */ - private static final long serialVersionUID = 20100614L; + private static final long serialVersionUID = 20120307L; /** Standard Constructor */ public X_C_DocType (Properties ctx, int C_DocType_ID, String trxName) @@ -92,9 +92,9 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return sb.toString(); } - public I_AD_PrintFormat getAD_PrintFormat() throws RuntimeException + public org.compiere.model.I_AD_PrintFormat getAD_PrintFormat() throws RuntimeException { - return (I_AD_PrintFormat)MTable.get(getCtx(), I_AD_PrintFormat.Table_Name) + return (org.compiere.model.I_AD_PrintFormat)MTable.get(getCtx(), org.compiere.model.I_AD_PrintFormat.Table_Name) .getPO(getAD_PrintFormat_ID(), get_TrxName()); } /** Set Print Format. @@ -120,9 +120,9 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return ii.intValue(); } - public I_C_DocType getC_DocTypeDifference() throws RuntimeException + public org.compiere.model.I_C_DocType getC_DocTypeDifference() throws RuntimeException { - return (I_C_DocType)MTable.get(getCtx(), I_C_DocType.Table_Name) + return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name) .getPO(getC_DocTypeDifference_ID(), get_TrxName()); } /** Set Difference Document. @@ -171,9 +171,9 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return ii.intValue(); } - public I_C_DocType getC_DocTypeInvoice() throws RuntimeException + public org.compiere.model.I_C_DocType getC_DocTypeInvoice() throws RuntimeException { - return (I_C_DocType)MTable.get(getCtx(), I_C_DocType.Table_Name) + return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name) .getPO(getC_DocTypeInvoice_ID(), get_TrxName()); } /** Set Document Type for Invoice. @@ -199,9 +199,9 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return ii.intValue(); } - public I_C_DocType getC_DocTypeProforma() throws RuntimeException + public org.compiere.model.I_C_DocType getC_DocTypeProforma() throws RuntimeException { - return (I_C_DocType)MTable.get(getCtx(), I_C_DocType.Table_Name) + return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name) .getPO(getC_DocTypeProforma_ID(), get_TrxName()); } /** Set Document Type for ProForma. @@ -227,9 +227,9 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return ii.intValue(); } - public I_C_DocType getC_DocTypeShipment() throws RuntimeException + public org.compiere.model.I_C_DocType getC_DocTypeShipment() throws RuntimeException { - return (I_C_DocType)MTable.get(getCtx(), I_C_DocType.Table_Name) + return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name) .getPO(getC_DocTypeShipment_ID(), get_TrxName()); } /** Set Document Type for Shipment. @@ -255,9 +255,23 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return ii.intValue(); } - public I_AD_Sequence getDefiniteSequence() throws RuntimeException + /** Set C_DocType_UU. + @param C_DocType_UU C_DocType_UU */ + public void setC_DocType_UU (String C_DocType_UU) + { + set_Value (COLUMNNAME_C_DocType_UU, C_DocType_UU); + } + + /** Get C_DocType_UU. + @return C_DocType_UU */ + public String getC_DocType_UU () + { + return (String)get_Value(COLUMNNAME_C_DocType_UU); + } + + public org.compiere.model.I_AD_Sequence getDefiniteSequence() throws RuntimeException { - return (I_AD_Sequence)MTable.get(getCtx(), I_AD_Sequence.Table_Name) + return (org.compiere.model.I_AD_Sequence)MTable.get(getCtx(), org.compiere.model.I_AD_Sequence.Table_Name) .getPO(getDefiniteSequence_ID(), get_TrxName()); } /** Set Definite Sequence. @@ -375,9 +389,9 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return (String)get_Value(COLUMNNAME_DocBaseType); } - public I_AD_Sequence getDocNoSequence() throws RuntimeException + public org.compiere.model.I_AD_Sequence getDocNoSequence() throws RuntimeException { - return (I_AD_Sequence)MTable.get(getCtx(), I_AD_Sequence.Table_Name) + return (org.compiere.model.I_AD_Sequence)MTable.get(getCtx(), org.compiere.model.I_AD_Sequence.Table_Name) .getPO(getDocNoSequence_ID(), get_TrxName()); } /** Set Document Sequence. @@ -476,9 +490,9 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return (String)get_Value(COLUMNNAME_DocumentNote); } - public I_GL_Category getGL_Category() throws RuntimeException + public org.compiere.model.I_GL_Category getGL_Category() throws RuntimeException { - return (I_GL_Category)MTable.get(getCtx(), I_GL_Category.Table_Name) + return (org.compiere.model.I_GL_Category)MTable.get(getCtx(), org.compiere.model.I_GL_Category.Table_Name) .getPO(getGL_Category_ID(), get_TrxName()); } /** Set GL Category. @@ -552,6 +566,27 @@ public class X_C_DocType extends PO implements I_C_DocType, I_Persistent return false; } + /** Set Mandatory Charge or Product. + @param IsChargeOrProductMandatory Mandatory Charge or Product */ + public void setIsChargeOrProductMandatory (boolean IsChargeOrProductMandatory) + { + set_Value (COLUMNNAME_IsChargeOrProductMandatory, Boolean.valueOf(IsChargeOrProductMandatory)); + } + + /** Get Mandatory Charge or Product. + @return Mandatory Charge or Product */ + public boolean isChargeOrProductMandatory () + { + Object oo = get_Value(COLUMNNAME_IsChargeOrProductMandatory); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Create Counter Document. @param IsCreateCounter Create Counter Document From 97b95b41ebb8162f56c9de3fec990234ad10d768 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Mar 2012 09:18:02 -0500 Subject: [PATCH 2/9] fix lastmigrationscript on script 823 --- migration/360lts-release/oracle/823_IDEMPIERE-178.sql | 5 +++++ migration/360lts-release/postgresql/823_IDEMPIERE-178.sql | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/migration/360lts-release/oracle/823_IDEMPIERE-178.sql b/migration/360lts-release/oracle/823_IDEMPIERE-178.sql index ef6f5031e5..2a43a512ac 100644 --- a/migration/360lts-release/oracle/823_IDEMPIERE-178.sql +++ b/migration/360lts-release/oracle/823_IDEMPIERE-178.sql @@ -82,3 +82,8 @@ INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTransla UPDATE AD_Message_Trl SET IsTranslated='Y',MsgText='En este documento se debe diligenciar el cargo o el producto',Updated=TO_DATE('2012-03-07 15:18:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200003 AND AD_Language LIKE 'es_%' ; +UPDATE AD_System + SET LastMigrationScriptApplied='823_IDEMPIERE-178.sql' +WHERE LastMigrationScriptApplied<'823_IDEMPIERE-178.sql' + OR LastMigrationScriptApplied IS NULL +; diff --git a/migration/360lts-release/postgresql/823_IDEMPIERE-178.sql b/migration/360lts-release/postgresql/823_IDEMPIERE-178.sql index b1e1aede6a..6b712ee109 100644 --- a/migration/360lts-release/postgresql/823_IDEMPIERE-178.sql +++ b/migration/360lts-release/postgresql/823_IDEMPIERE-178.sql @@ -82,3 +82,8 @@ INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTransla UPDATE AD_Message_Trl SET IsTranslated='Y',MsgText='En este documento se debe diligenciar el cargo o el producto',Updated=TO_TIMESTAMP('2012-03-07 15:18:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200003 AND AD_Language LIKE 'es_%' ; +UPDATE AD_System + SET LastMigrationScriptApplied='823_IDEMPIERE-178.sql' +WHERE LastMigrationScriptApplied<'823_IDEMPIERE-178.sql' + OR LastMigrationScriptApplied IS NULL +; From 36494f3e917df07e7c077a3b86287a1b4578591e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 14 Mar 2012 15:34:21 -0500 Subject: [PATCH 3/9] IDEMPIERE-198 GL Distribution Generate Wrong Fact Entry when the Create Reversal is NO http://jira.idempiere.com/browse/IDEMPIERE-198 --- .../src/org/compiere/acct/FactLine.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/acct/FactLine.java b/org.adempiere.base/src/org/compiere/acct/FactLine.java index 3db1ea45b0..37b2ba292a 100644 --- a/org.adempiere.base/src/org/compiere/acct/FactLine.java +++ b/org.adempiere.base/src/org/compiere/acct/FactLine.java @@ -112,6 +112,21 @@ public final class FactLine extends X_Fact_Acct reversal.setQty(getQty().negate()); reversal.convert(); reversal.setDescription(description); + + reversal.setC_BPartner_ID(getC_BPartner_ID()); + reversal.setM_Product_ID(getM_Product_ID()); + reversal.setC_Project_ID(getC_Project_ID()); + reversal.setC_Campaign_ID(getC_Campaign_ID()); + reversal.setC_Activity_ID(getC_Activity_ID()); + reversal.setAD_OrgTrx_ID(getAD_OrgTrx_ID()); + reversal.setC_SalesRegion_ID(getC_SalesRegion_ID()); + reversal.setC_LocTo_ID(getC_LocTo_ID()); + reversal.setC_LocFrom_ID(getC_LocFrom_ID()); + reversal.setUser1_ID(getUser1_ID()); + reversal.setUser2_ID(getUser1_ID()); + reversal.setUserElement1_ID(getUserElement1_ID()); + reversal.setUserElement2_ID(getUserElement2_ID()); + return reversal; } // reverse From cc07ae21b7a68003a41d722364d874469222370d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 14 Mar 2012 19:47:50 -0500 Subject: [PATCH 4/9] IDEMPIERE-191 Product Info search dialog assign the wrong value to the name field. http://jira.idempiere.com/browse/IDEMPIERE-191 --- .../org/compiere/apps/search/InfoProduct.java | 8 +++++--- .../adempiere/webui/editor/WSearchEditor.java | 16 ++++++++++++++-- .../adempiere/webui/panel/InfoProductPanel.java | 5 +++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java index 50da19ae75..21dc2e3a55 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java @@ -480,9 +480,11 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener // Pick init fillPicks(M_PriceList_ID); int M_PriceList_Version_ID = findPLV (M_PriceList_ID); - // Set Value or Name - if (value.startsWith("@") && value.endsWith("@")) - fieldName.setText(value.substring(1,value.length()-1)); + // Set Value + if (value != null && value.length() > 0 && value.indexOf("_") > 0) { + String values[] = value.split("_"); + fieldValue.setText(values[0]); + } else fieldValue.setText(value); // Set Warehouse diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java index 73411af9df..bafbebfc96 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java @@ -203,7 +203,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value public void onEvent(Event e) { - if (Events.ON_CHANGE.equals(e.getName()) || Events.ON_OK.equals(e.getName())) + if (Events.ON_CHANGE.equals(e.getName())) { if (infoPanel != null) { @@ -211,7 +211,19 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value infoPanel = null; } actionText(getComponent().getText()); - + } + else if ((Events.ON_OK.equals(e.getName()))) { + if (getComponent().getText() == null || getComponent().getText().length() == 0) { + // open Info window similar to swing client + if (infoPanel != null) + { + infoPanel.detach(); + infoPanel = null; + } + actionText(getComponent().getText()); + } else { + actionRefresh(getValue()); + } } else if (Events.ON_CLICK.equals(e.getName())) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java index 0901b9bf79..ca9a7e2472 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java @@ -203,6 +203,11 @@ public class InfoProductPanel extends InfoPanel implements EventListener // AutoQuery if (value != null && value.length() > 0) { + // Set Value + if (value.indexOf("_") > 0) { + String values[] = value.split("_"); + value = values[0]; + } // Set Value or Name fieldValue.setText(value); testCount(); From 7367d59ef7560cc5c8c8828d8c29b4399242d2c3 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 14 Mar 2012 21:02:11 -0500 Subject: [PATCH 5/9] IDEMPIERE-127 Implement Recent Items dashboard / Don't save migration script for recent items table http://jira.idempiere.com/browse/IDEMPIERE-127 --- org.adempiere.base/src/org/compiere/dbPort/Convert.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.adempiere.base/src/org/compiere/dbPort/Convert.java b/org.adempiere.base/src/org/compiere/dbPort/Convert.java index 66c002bfce..c0011309b2 100644 --- a/org.adempiere.base/src/org/compiere/dbPort/Convert.java +++ b/org.adempiere.base/src/org/compiere/dbPort/Convert.java @@ -485,6 +485,7 @@ public abstract class Convert "AD_PINSTANCE", "AD_PINSTANCE_LOG", "AD_PINSTANCE_PARA", + "AD_RECENTITEM", "AD_REPLICATION_LOG", "AD_SCHEDULERLOG", "AD_SESSION", From 3687d3f778947df4e9cfae93750ad1f4a12c5f06 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 14 Mar 2012 21:49:10 -0500 Subject: [PATCH 6/9] IDEMPIERE-187 Support developer to generate migration script from webui http://jira.idempiere.com/browse/IDEMPIERE-187 --- .../src/org/compiere/dbPort/Convert.java | 9 ++++- .../src/org/compiere/model/MSequence.java | 34 +++++++++++++++++-- .../adempiere/webui/window/WPreference.java | 33 +++++++++++++++++- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/dbPort/Convert.java b/org.adempiere.base/src/org/compiere/dbPort/Convert.java index c0011309b2..8ac61c2e8e 100644 --- a/org.adempiere.base/src/org/compiere/dbPort/Convert.java +++ b/org.adempiere.base/src/org/compiere/dbPort/Convert.java @@ -39,6 +39,7 @@ import org.compiere.db.Database; import org.compiere.model.MSysConfig; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; +import org.compiere.util.Env; import org.compiere.util.Ini; /** @@ -435,7 +436,13 @@ public abstract class Convert public static void logMigrationScript(String oraStatement, String pgStatement) { // Check AdempiereSys // check property Log migration script - boolean logMigrationScript = Ini.isPropertyBool(Ini.P_LOGMIGRATIONSCRIPT); + boolean logMigrationScript = false; + if (Ini.isClient()) { + logMigrationScript = Ini.isPropertyBool(Ini.P_LOGMIGRATIONSCRIPT); + } else { + String sysProperty = Env.getCtx().getProperty("LogMigrationScript", "N"); + logMigrationScript = "y".equalsIgnoreCase(sysProperty) || "true".equalsIgnoreCase(sysProperty); + } if (logMigrationScript) { if (dontLog(oraStatement)) return; diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 5f4b2bb1ea..79689e02e3 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -88,7 +88,17 @@ public class MSequence extends X_AD_Sequence int retValue = -1; // Check AdempiereSys - boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + boolean adempiereSys = false; + if (Ini.isClient()) + { + adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + } + else + { + String sysProperty = Env.getCtx().getProperty("AdempiereSys", "N"); + adempiereSys = "y".equalsIgnoreCase(sysProperty) || "true".equalsIgnoreCase(sysProperty); + } + if (adempiereSys && AD_Client_ID > 11) adempiereSys = false; // @@ -398,7 +408,16 @@ public class MSequence extends X_AD_Sequence throw new IllegalArgumentException("TableName missing"); // Check AdempiereSys - boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + boolean adempiereSys = false; + if (Ini.isClient()) + { + adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + } + else + { + String sysProperty = Env.getCtx().getProperty("AdempiereSys", "N"); + adempiereSys = "y".equalsIgnoreCase(sysProperty) || "true".equalsIgnoreCase(sysProperty); + } if (adempiereSys && AD_Client_ID > 11) adempiereSys = false; // @@ -704,7 +723,16 @@ public class MSequence extends X_AD_Sequence } // Check AdempiereSys - boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + boolean adempiereSys = false; + if (Ini.isClient()) + { + adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + } + else + { + String sysProperty = Env.getCtx().getProperty("AdempiereSys", "N"); + adempiereSys = "y".equalsIgnoreCase(sysProperty) || "true".equalsIgnoreCase(sysProperty); + } if (CLogMgt.isLevel(LOGLEVEL)) s_log.log(LOGLEVEL, "DocType_ID=" + C_DocType_ID + " [" + trxName + "]"); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPreference.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPreference.java index 0f19974b01..95e768fd67 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPreference.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPreference.java @@ -37,11 +37,16 @@ import org.zkoss.zul.Space; * */ public class WPreference extends Popup implements EventListener { + /** + * + */ + private static final long serialVersionUID = -8223456746437563389L; - private static final long serialVersionUID = 7163067116469715021L; private WYesNoEditor autoCommit; private WYesNoEditor autoNew; private WYesNoEditor tabCollapsible; + private WYesNoEditor adempiereSys; + private WYesNoEditor logMigrationScript; private Listbox tabPlacement; public WPreference() { @@ -88,6 +93,26 @@ public class WPreference extends Popup implements EventListener { div.appendChild(tabPlacement); this.appendChild(div); + if (Env.getAD_Client_ID(Env.getCtx()) <= 20 && Env.getAD_User_ID(Env.getCtx()) <= 102) { + adempiereSys = new WYesNoEditor("AdempiereSys", Msg.getMsg(Env.getCtx(), "AdempiereSys", true), + null, false, false, true); + adempiereSys.getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "AdempiereSys", false)); + div = new Div(); + div.setStyle("background-color: transparent !important; border: none; margin: 5px;"); + div.appendChild(adempiereSys.getComponent()); + this.appendChild(div); + adempiereSys.setValue(Env.getCtx().getProperty("AdempiereSys")); + + logMigrationScript = new WYesNoEditor("LogMigrationScript", Msg.getMsg(Env.getCtx(), "LogMigrationScript", true), + null, false, false, true); + logMigrationScript.getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "LogMigrationScript", false)); + div = new Div(); + div.setStyle("background-color: transparent !important; border: none; margin: 5px;"); + div.appendChild(logMigrationScript.getComponent()); + this.appendChild(div); + logMigrationScript.setValue(Env.getCtx().getProperty("LogMigrationScript")); + } + Separator separator = new Separator(); separator.setSpacing("20px"); div = new Div(); @@ -134,6 +159,12 @@ public class WPreference extends Popup implements EventListener { //update context Env.setAutoCommit(Env.getCtx(), "y".equalsIgnoreCase(preference.getProperty(UserPreference.P_AUTO_COMMIT))); Env.setAutoNew(Env.getCtx(), "y".equalsIgnoreCase(preference.getProperty(UserPreference.P_AUTO_NEW))); + + // Log Migration Script and AdempiereSys are just in-memory preferences, must not be saved + if (logMigrationScript != null) + Env.getCtx().setProperty("LogMigrationScript", (Boolean)logMigrationScript.getValue() ? "Y" : "N"); + if (adempiereSys != null) + Env.getCtx().setProperty("AdempiereSys", (Boolean)adempiereSys.getValue() ? "Y" : "N"); this.detach(); } From 628e1c63e381099f6d5dfd96c1c433933d2482b1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 14 Mar 2012 22:04:23 -0500 Subject: [PATCH 7/9] IDEMPIERE-127 Implement Recent Items dashboard / Don't use centralized IDs for recent items table http://jira.idempiere.com/browse/IDEMPIERE-127 --- org.adempiere.base/src/org/compiere/model/MSequence.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 79689e02e3..29af818d8e 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -1608,6 +1608,7 @@ public class MSequence extends X_AD_Sequence "AD_PINSTANCE", "AD_PINSTANCE_LOG", "AD_PINSTANCE_PARA", + "AD_RECENTITEM", "AD_REPLICATION_LOG", "AD_SCHEDULERLOG", "AD_SESSION", From 8274bb6acc22491c5205ae95da3d5959da0ba937 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 15 Mar 2012 17:18:09 +0800 Subject: [PATCH 8/9] IDEMPIERE-199 Deployed instance cannot be updated using equinox p2 director --- org.adempiere.server-feature/product.ant | 1 + org.adempiere.server-feature/server.product | 1 + 2 files changed, 2 insertions(+) diff --git a/org.adempiere.server-feature/product.ant b/org.adempiere.server-feature/product.ant index 1e477c5b3b..ce8f9c695f 100644 --- a/org.adempiere.server-feature/product.ant +++ b/org.adempiere.server-feature/product.ant @@ -39,6 +39,7 @@ + diff --git a/org.adempiere.server-feature/server.product b/org.adempiere.server-feature/server.product index 843b7747b6..e2c6986e99 100644 --- a/org.adempiere.server-feature/server.product +++ b/org.adempiere.server-feature/server.product @@ -53,6 +53,7 @@ + From 156178f2747be6804b7a9a0f83aacaec3572dfb5 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 16 Mar 2012 03:35:40 +0800 Subject: [PATCH 9/9] IDEMPIERE-155 Generating Installer for Other Platform Required the use of Delta Pack --- org.adempiere.sdk-feature/feature.xml | 73 +++++++++++++++++++ org.adempiere.server-feature/build.properties | 7 ++ 2 files changed, 80 insertions(+) diff --git a/org.adempiere.sdk-feature/feature.xml b/org.adempiere.sdk-feature/feature.xml index 6dc4c4ec54..e704f8af66 100644 --- a/org.adempiere.sdk-feature/feature.xml +++ b/org.adempiere.sdk-feature/feature.xml @@ -29,4 +29,77 @@ id="org.adempiere.ui.swing" version="0.0.0"/> + + + + + + + + + + + + + + diff --git a/org.adempiere.server-feature/build.properties b/org.adempiere.server-feature/build.properties index 9727799c0b..ecb97e285c 100644 --- a/org.adempiere.server-feature/build.properties +++ b/org.adempiere.server-feature/build.properties @@ -14,6 +14,13 @@ root.linux.gtk.x86.permissions.755=*.sh,**/*.sh root.macosx.cocoa.x86=file:setup.sh,file:console-setup.sh,file:adempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh root.macosx.cocoa.x86.folder.utils=utils.unix root.macosx.cocoa.x86.permissions.755=*.sh,**/*.sh +#mac 64 +root.macosx.cocoa.x86_64=file:setup.sh,file:console-setup.sh,file:adempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh +root.macosx.cocoa.x86_64.folder.utils=utils.unix +root.macosx.cocoa.x86_64.permissions.755=*.sh,**/*.sh #windows root.win32.win32.x86=file:setup.bat,file:console-setup.bat,file:adempiere-server.bat,file:setup-alt.bat,file:console-setup-alt.bat root.win32.win32.x86.folder.utils=utils.unix +#windows 64 +root.win32.win32.x86_64=file:setup.bat,file:console-setup.bat,file:adempiere-server.bat,file:setup-alt.bat,file:console-setup-alt.bat +root.win32.win32.x86_64.folder.utils=utils.unix