IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge

http://jira.idempiere.com/browse/IDEMPIERE-178
This commit is contained in:
Carlos Ruiz 2012-03-07 16:07:19 -05:00
parent 96687acab4
commit b449ccf1db
8 changed files with 289 additions and 26 deletions

View File

@ -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_%'
;

View File

@ -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_%'
;

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

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