FR [ 1696228 ] ModelValidator for BeforePost and AfterPost

Publish required methods to customize accounting facts in Validator
This commit is contained in:
Carlos Ruiz 2007-05-09 06:03:21 +00:00
parent ca3ebb02b7
commit d640fc4190
2 changed files with 113 additions and 56 deletions

View File

@ -158,12 +158,25 @@ public interface IDoc {
*/ */
public abstract BigDecimal getAmount(int AmtType); // getAmount public abstract BigDecimal getAmount(int AmtType); // getAmount
/**
* Set the Amount
* @param AmtType see AMTTYPE_*
* @param amt Amount
*/
public void setAmount(int AmtType, BigDecimal amt);
/** /**
* Get Amount with index 0 * Get Amount with index 0
* @return Amount (primary document amount) * @return Amount (primary document amount)
*/ */
public abstract BigDecimal getAmount(); // getAmount public abstract BigDecimal getAmount(); // getAmount
/**
* Set Quantity
* @param qty Quantity
*/
public void setQty (BigDecimal qty);
/** /**
* Get Quantity * Get Quantity
* @return Quantity * @return Quantity
@ -290,12 +303,24 @@ public interface IDoc {
*/ */
public abstract boolean isMultiCurrency(); // isMultiCurrency public abstract boolean isMultiCurrency(); // isMultiCurrency
/**
* Set Multi Currency
* @param mc multi currency
*/
public void setIsMultiCurrency (boolean mc);
/** /**
* Is Tax Included * Is Tax Included
* @return tax incl * @return tax incl
*/ */
public abstract boolean isTaxIncluded(); // isTaxIncluded public abstract boolean isTaxIncluded(); // isTaxIncluded
/**
* Set Tax Includedy
* @param ti Tax Included
*/
public void setIsTaxIncluded (boolean ti);
/** /**
* Get C_ConversionType_ID * Get C_ConversionType_ID
* @return ConversionType * @return ConversionType
@ -320,12 +345,24 @@ public interface IDoc {
*/ */
public abstract Timestamp getDateAcct(); // getDateAcct public abstract Timestamp getDateAcct(); // getDateAcct
/**
* Set Date Acct
* @param da accounting date
*/
public void setDateAcct (Timestamp da);
/** /**
* Get Document Date * Get Document Date
* @return currency * @return currency
*/ */
public abstract Timestamp getDateDoc(); // getDateDoc public abstract Timestamp getDateDoc(); // getDateDoc
/**
* Set Date Doc
* @param dd document date
*/
public void setDateDoc (Timestamp dd);
/** /**
* Is Document Posted * Is Document Posted
* @return true if posted * @return true if posted
@ -362,12 +399,24 @@ public interface IDoc {
*/ */
public abstract int getC_BankAccount_ID(); // getC_BankAccount_ID public abstract int getC_BankAccount_ID(); // getC_BankAccount_ID
/**
* Set C_BankAccount_ID
* @param C_BankAccount_ID bank acct
*/
public void setC_BankAccount_ID (int C_BankAccount_ID);
/** /**
* Get C_CashBook_ID * Get C_CashBook_ID
* @return CashBook * @return CashBook
*/ */
public abstract int getC_CashBook_ID(); // getC_CashBook_ID public abstract int getC_CashBook_ID(); // getC_CashBook_ID
/**
* Set C_CashBook_ID
* @param C_CashBook_ID cash book
*/
public void setC_CashBook_ID (int C_CashBook_ID);
/** /**
* Get M_Warehouse_ID * Get M_Warehouse_ID
* @return Warehouse * @return Warehouse
@ -380,6 +429,12 @@ public interface IDoc {
*/ */
public abstract int getC_BPartner_ID(); // getC_BPartner_ID public abstract int getC_BPartner_ID(); // getC_BPartner_ID
/**
* Set C_BPartner_ID
* @param C_BPartner_ID bp
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** /**
* Get C_BPartner_Location_ID * Get C_BPartner_Location_ID
* @return BPartner Location * @return BPartner Location
@ -434,12 +489,24 @@ public interface IDoc {
*/ */
public abstract int getC_LocFrom_ID(); // getC_LocFrom_ID public abstract int getC_LocFrom_ID(); // getC_LocFrom_ID
/**
* Set C_LocFrom_ID
* @param C_LocFrom_ID loc from
*/
public void setC_LocFrom_ID(int C_LocFrom_ID);
/** /**
* Get C_LocTo_ID * Get C_LocTo_ID
* @return loc to * @return loc to
*/ */
public abstract int getC_LocTo_ID(); // getC_LocTo_ID public abstract int getC_LocTo_ID(); // getC_LocTo_ID
/**
* Set C_LocTo_ID
* @param C_LocTo_ID loc to
*/
public void setC_LocTo_ID(int C_LocTo_ID);
/** /**
* Get User1_ID * Get User1_ID
* @return Campaign * @return Campaign
@ -484,6 +551,13 @@ public interface IDoc {
*/ */
public String getDocumentType(); public String getDocumentType();
/**
* Load Document Type and GL Info.
* Set p_DocumentType and p_GL_Category_ID
* @param DocumentType
*/
public void setDocumentType (String DocumentType);
/** /**
* Set C_SalesRegion_ID * Set C_SalesRegion_ID
* @param C_SalesRegion_ID id * @param C_SalesRegion_ID id

View File

@ -776,10 +776,8 @@ public abstract class Doc implements IDoc
} // unlock } // unlock
/************************************************************************** /* (non-Javadoc)
* Load Document Type and GL Info. * @see org.compiere.acct.IDoc#getDocumentType()
* Set p_DocumentType and p_GL_Category_ID
* @return document type
*/ */
public String getDocumentType() public String getDocumentType()
{ {
@ -788,12 +786,10 @@ public abstract class Doc implements IDoc
return m_DocumentType; return m_DocumentType;
} // getDocumentType } // getDocumentType
/** /* (non-Javadoc)
* Load Document Type and GL Info. * @see org.compiere.acct.IDoc#setDocumentType()
* Set p_DocumentType and p_GL_Category_ID
* @param DocumentType
*/ */
protected void setDocumentType (String DocumentType) public void setDocumentType (String DocumentType)
{ {
if (DocumentType != null) if (DocumentType != null)
m_DocumentType = DocumentType; m_DocumentType = DocumentType;
@ -876,7 +872,6 @@ public abstract class Doc implements IDoc
throw new IllegalStateException("Document Type not found"); throw new IllegalStateException("Document Type not found");
} // setDocumentType } // setDocumentType
/* (non-Javadoc) /* (non-Javadoc)
* @see org.compiere.acct.IDoc#isBalanced() * @see org.compiere.acct.IDoc#isBalanced()
*/ */
@ -1017,12 +1012,10 @@ public abstract class Doc implements IDoc
return m_Amounts[AmtType]; return m_Amounts[AmtType];
} // getAmount } // getAmount
/** /* (non-Javadoc)
* Set the Amount * @see org.compiere.acct.IDoc#setAmount(int, BigDecimal)
* @param AmtType see AMTTYPE_*
* @param amt Amount
*/ */
protected void setAmount(int AmtType, BigDecimal amt) public void setAmount(int AmtType, BigDecimal amt)
{ {
if (AmtType < 0 || AmtType >= m_Amounts.length) if (AmtType < 0 || AmtType >= m_Amounts.length)
return; return;
@ -1040,11 +1033,10 @@ public abstract class Doc implements IDoc
return m_Amounts[0]; return m_Amounts[0];
} // getAmount } // getAmount
/** /* (non-Javadoc)
* Set Quantity * @see org.compiere.acct.IDoc#setQty(BigDecimal)
* @param qty Quantity
*/ */
protected void setQty (BigDecimal qty) public void setQty (BigDecimal qty)
{ {
m_qty = qty; m_qty = qty;
} // setQty } // setQty
@ -1424,11 +1416,10 @@ public abstract class Doc implements IDoc
return m_MultiCurrency; return m_MultiCurrency;
} // isMultiCurrency } // isMultiCurrency
/** /* (non-Javadoc)
* Set Multi Currency * @see org.compiere.acct.IDoc#setIsMultiCurrency(boolean)
* @param mc multi currency
*/ */
protected void setIsMultiCurrency (boolean mc) public void setIsMultiCurrency (boolean mc)
{ {
m_MultiCurrency = mc; m_MultiCurrency = mc;
} // setIsMultiCurrency } // setIsMultiCurrency
@ -1441,11 +1432,10 @@ public abstract class Doc implements IDoc
return m_TaxIncluded; return m_TaxIncluded;
} // isTaxIncluded } // isTaxIncluded
/** /* (non-Javadoc)
* Set Tax Includedy * @see org.compiere.acct.IDoc#setIsTaxIncluded(boolean)
* @param ti Tax Included
*/ */
protected void setIsTaxIncluded (boolean ti) public void setIsTaxIncluded (boolean ti)
{ {
m_TaxIncluded = ti; m_TaxIncluded = ti;
} // setIsTaxIncluded } // setIsTaxIncluded
@ -1505,11 +1495,10 @@ public abstract class Doc implements IDoc
throw new IllegalStateException("No DateAcct"); throw new IllegalStateException("No DateAcct");
} // getDateAcct } // getDateAcct
/** /* (non-Javadoc)
* Set Date Acct * @see org.compiere.acct.IDoc#setDateAcct(Timestamp)
* @param da accounting date
*/ */
protected void setDateAcct (Timestamp da) public void setDateAcct (Timestamp da)
{ {
m_DateAcct = da; m_DateAcct = da;
} // setDateAcct } // setDateAcct
@ -1533,11 +1522,10 @@ public abstract class Doc implements IDoc
throw new IllegalStateException("No DateDoc"); throw new IllegalStateException("No DateDoc");
} // getDateDoc } // getDateDoc
/** /* (non-Javadoc)
* Set Date Doc * @see org.compiere.acct.IDoc#setDateDoc(Timestamp)
* @param dd document date
*/ */
protected void setDateDoc (Timestamp dd) public void setDateDoc (Timestamp dd)
{ {
m_DateDoc = dd; m_DateDoc = dd;
} // setDateDoc } // setDateDoc
@ -1650,15 +1638,14 @@ public abstract class Doc implements IDoc
return m_C_BankAccount_ID; return m_C_BankAccount_ID;
} // getC_BankAccount_ID } // getC_BankAccount_ID
/** /* (non-Javadoc)
* Set C_BankAccount_ID * @see org.compiere.acct.IDoc#setC_BankAccount_ID(int)
* @param C_BankAccount_ID bank acct
*/ */
protected void setC_BankAccount_ID (int C_BankAccount_ID) public void setC_BankAccount_ID (int C_BankAccount_ID)
{ {
m_C_BankAccount_ID = C_BankAccount_ID; m_C_BankAccount_ID = C_BankAccount_ID;
} // setC_BankAccount_ID } // setC_BankAccount_ID
/* (non-Javadoc) /* (non-Javadoc)
* @see org.compiere.acct.IDoc#getC_CashBook_ID() * @see org.compiere.acct.IDoc#getC_CashBook_ID()
*/ */
@ -1679,11 +1666,10 @@ public abstract class Doc implements IDoc
return m_C_CashBook_ID; return m_C_CashBook_ID;
} // getC_CashBook_ID } // getC_CashBook_ID
/** /* (non-Javadoc)
* Set C_CashBook_ID * @see org.compiere.acct.IDoc#setC_CashBook_ID(int)
* @param C_CashBook_ID cash book
*/ */
protected void setC_CashBook_ID (int C_CashBook_ID) public void setC_CashBook_ID (int C_CashBook_ID)
{ {
m_C_CashBook_ID = C_CashBook_ID; m_C_CashBook_ID = C_CashBook_ID;
} // setC_CashBook_ID } // setC_CashBook_ID
@ -1724,11 +1710,10 @@ public abstract class Doc implements IDoc
return m_C_BPartner_ID; return m_C_BPartner_ID;
} // getC_BPartner_ID } // getC_BPartner_ID
/** /* (non-Javadoc)
* Set C_BPartner_ID * @see org.compiere.acct.IDoc#setC_BPartner_ID()
* @param C_BPartner_ID bp
*/ */
protected void setC_BPartner_ID (int C_BPartner_ID) public void setC_BPartner_ID (int C_BPartner_ID)
{ {
m_C_BPartner_ID = C_BPartner_ID; m_C_BPartner_ID = C_BPartner_ID;
} // setC_BPartner_ID } // setC_BPartner_ID
@ -1875,11 +1860,10 @@ public abstract class Doc implements IDoc
return m_C_LocFrom_ID; return m_C_LocFrom_ID;
} // getC_LocFrom_ID } // getC_LocFrom_ID
/** /* (non-Javadoc)
* Set C_LocFrom_ID * @see org.compiere.acct.IDoc#setC_LocFrom_ID(int)
* @param C_LocFrom_ID loc from
*/ */
protected void setC_LocFrom_ID(int C_LocFrom_ID) public void setC_LocFrom_ID(int C_LocFrom_ID)
{ {
m_C_LocFrom_ID = C_LocFrom_ID; m_C_LocFrom_ID = C_LocFrom_ID;
} // setC_LocFrom_ID } // setC_LocFrom_ID
@ -1892,11 +1876,10 @@ public abstract class Doc implements IDoc
return m_C_LocTo_ID; return m_C_LocTo_ID;
} // getC_LocTo_ID } // getC_LocTo_ID
/** /* (non-Javadoc)
* Set C_LocTo_ID * @see org.compiere.acct.IDoc#setC_LocTo_ID(int)
* @param C_LocTo_ID loc to
*/ */
protected void setC_LocTo_ID(int C_LocTo_ID) public void setC_LocTo_ID(int C_LocTo_ID)
{ {
m_C_LocTo_ID = C_LocTo_ID; m_C_LocTo_ID = C_LocTo_ID;
} // setC_LocTo_ID } // setC_LocTo_ID