Merge with idempiere head

This commit is contained in:
Heng Sin Low 2012-03-19 01:06:51 +08:00
commit 4d8457536f
19 changed files with 493 additions and 36 deletions

View File

@ -0,0 +1,89 @@
-- 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_%'
;
UPDATE AD_System
SET LastMigrationScriptApplied='823_IDEMPIERE-178.sql'
WHERE LastMigrationScriptApplied<'823_IDEMPIERE-178.sql'
OR LastMigrationScriptApplied IS NULL
;

View File

@ -0,0 +1,89 @@
-- 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_%'
;
UPDATE AD_System
SET LastMigrationScriptApplied='823_IDEMPIERE-178.sql'
WHERE LastMigrationScriptApplied<'823_IDEMPIERE-178.sql'
OR LastMigrationScriptApplied IS NULL
;

View File

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

View File

@ -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;
@ -485,6 +492,7 @@ public abstract class Convert
"AD_PINSTANCE",
"AD_PINSTANCE_LOG",
"AD_PINSTANCE_PARA",
"AD_RECENTITEM",
"AD_REPLICATION_LOG",
"AD_SCHEDULERLOG",
"AD_SESSION",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 + "]");
@ -1580,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",

View File

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

View File

@ -29,4 +29,77 @@
id="org.adempiere.ui.swing"
version="0.0.0"/>
<plugin
id="org.eclipse.swt"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.swt.win32.win32.x86"
os="win32"
ws="win32"
arch="x86"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.swt.win32.win32.x86_64"
os="win32"
ws="win32"
arch="x86_64"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.swt.gtk.linux.x86"
os="linux"
ws="gtk"
arch="x86"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.swt.gtk.linux.x86_64"
os="linux"
ws="gtk"
arch="x86_64"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.swt.cocoa.macosx"
os="macosx"
ws="cocoa"
arch="x86"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.swt.cocoa.macosx.x86_64"
os="macosx"
ws="cocoa"
arch="x86_64"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
</feature>

View File

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

View File

@ -39,6 +39,7 @@
<arg value="-p2.arch" />
<arg value="${target.arch}" />
<arg value="-consoleLog"/>
<arg value="-roaming"/>
<!-- jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/ -->
</java>
</target>

View File

@ -53,6 +53,7 @@
<plugin id="org.eclipse.gemini.web.tomcat" autoStart="true" startLevel="4" />
<plugin id="org.eclipse.osgi.services" autoStart="true" startLevel="3" />
<plugin id="org.restlet" autoStart="true" startLevel="3" />
<property name="org.eclipse.update.reconcile" value="false" />
</configurations>
</product>

View File

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

View File

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

View File

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

View File

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