📄 account.java
字号:
// 20 - User2_ID
if (User2_ID != 0)
cstmt.setInt(20, User2_ID);
else
cstmt.setNull(20, Types.NUMERIC);
//
cstmt.executeUpdate();
C_ValidCombination_ID = cstmt.getInt(1); // 1 - ID
cstmt.close();
m_changed = true;
saved = true;
}
catch(SQLException e)
{
Log.error("Account.save", e);
m_changed = false;
}
//
load(C_ValidCombination_ID);
return saved;
} // save
/*************************************************************************/
/**
* Return String representation
* @return String
*/
public String toString()
{
StringBuffer sb = new StringBuffer("Account=[");
sb.append(C_ValidCombination_ID)
.append(",Client=").append(AD_Client_ID)
.append(",Org=").append(AD_Org_ID)
.append(",Acct=").append(Account_ID);
// sb.append(",U1=").append(User1_ID);
sb.append("]");
return sb.toString();
} // toString
/**
* Is this a Balance Sheet Account
* @return boolean
*/
public boolean isBalanceSheet()
{
return (m_AcctType == 'A' || m_AcctType == 'L' || m_AcctType == 'O');
} // isBalanceSheet
/**
* Is this an Activa Account
* @return boolean
*/
public boolean isActiva()
{
return m_AcctType == 'A';
} // isActive
/**
* Is this a Passiva Account
* @return boolean
*/
public boolean isPassiva()
{
return m_AcctType == 'L' || m_AcctType == 'O';
} // isPassiva
/*************************************************************************/
/**
* Check Account Validity.
*
* Reads information from C_ElementValue
* - Set Account Type - A,L,O,E,R
* - Set Post...
* - Set Is ForeignCurrenvy
* @return boolean
*/
public boolean isValid()
{
if (m_OldAccount_ID == Account_ID && m_IsValid != null)
return m_IsValid.booleanValue();
m_OldAccount_ID = Account_ID;
String sql = "SELECT AccountType,PostActual,PostBudget,PostEncumbrance,PostStatistical,IsForeignCurrency,C_Currency_ID "
+ "FROM C_ElementValue "
+ "WHERE C_ElementValue_ID=? AND IsActive='Y' AND IsSummary='N'";
String str = null;
try
{
PreparedStatement pstmt = DB.prepareStatement(sql);
pstmt.setInt(1, Account_ID);
ResultSet rs = pstmt.executeQuery();
if (rs.next())
str = rs.getString(1);
rs.close();
pstmt.close();
}
catch (SQLException e)
{
Log.error ("Account.getAccountType", e);
}
catch (Exception e2)
{
Log.error("Account.getAccountType", e2);
}
if (str == null || str.length() == 0)
{
Log.error("Account.getAccountType - Type not found");
m_IsValid = new Boolean (false);
m_AcctType = '?';
}
else
{
m_IsValid = new Boolean (true);
m_AcctType = str.charAt(0);
}
return m_IsValid.booleanValue();
} // isValid
/*************************************************************************/
/**
* Get VC
* @param newC_ValidCombination_ID combination
*/
public void setC_ValidCombination_ID(int newC_ValidCombination_ID)
{
C_ValidCombination_ID = newC_ValidCombination_ID;
m_changed = true;
}
public int getC_ValidCombination_ID()
{
return C_ValidCombination_ID;
}
public void setAD_Client_ID(int newAD_Client_ID)
{
AD_Client_ID = newAD_Client_ID;
m_changed = true;
}
public int getAD_Client_ID()
{
return AD_Client_ID;
}
public void setAD_Org_ID(int newAD_Org_ID)
{
AD_Org_ID = newAD_Org_ID;
m_changed = true;
}
public int getAD_Org_ID()
{
return AD_Org_ID;
}
public void setActive(boolean newActive)
{
active = newActive;
m_changed = true;
}
public boolean isActive()
{
return active;
}
public void setUpdatedBy(int newUpdatedBy)
{
updatedBy = newUpdatedBy;
m_changed = true;
}
public int getUpdatedBy()
{
return updatedBy;
}
public void setAlias(String newAlias)
{
alias = newAlias;
m_changed = true;
}
public String getAlias()
{
return alias;
}
public void setCombination(String newCombination)
{
combination = newCombination;
m_changed = true;
}
public String getCombination()
{
return combination;
}
public void setDescription(String newDescription)
{
description = newDescription;
m_changed = true;
}
public String getDescription()
{
return description;
}
public void setFullyQualified(boolean newFullyQualified)
{
fullyQualified = newFullyQualified;
m_changed = true;
}
public boolean isFullyQualified()
{
return fullyQualified;
}
public void setC_AcctSchema_ID(int newC_AcctSchema_ID)
{
C_AcctSchema_ID = newC_AcctSchema_ID;
m_changed = true;
}
public int getC_AcctSchema_ID()
{
return C_AcctSchema_ID;
}
public void setAccount_ID(int newAccount_ID)
{
Account_ID = newAccount_ID;
m_changed = true;
}
public int getAccount_ID()
{
return Account_ID;
}
public void setM_Product_ID(int newM_Product_ID)
{
M_Product_ID = newM_Product_ID;
m_changed = true;
}
public int getM_Product_ID()
{
return M_Product_ID;
}
public void setC_BPartner_ID(int newC_BPartner_ID)
{
C_BPartner_ID = newC_BPartner_ID;
m_changed = true;
}
public int getC_BPartner_ID()
{
return C_BPartner_ID;
}
public void setAD_OrgTrx_ID(int newAD_OrgTrx_ID)
{
AD_OrgTrx_ID = newAD_OrgTrx_ID;
m_changed = true;
}
public int getAD_OrgTrx_ID()
{
return AD_OrgTrx_ID;
}
public void setC_LocFrom_ID(int newC_LocFrom_ID)
{
C_LocFrom_ID = newC_LocFrom_ID;
m_changed = true;
}
public int getC_LocFrom_ID()
{
return C_LocFrom_ID;
}
public void setC_LocTo_ID(int newC_LocTo_ID)
{
C_LocTo_ID = newC_LocTo_ID;
m_changed = true;
}
public int getC_LocTo_ID()
{
return C_LocTo_ID;
}
public void setC_SalesRegion_ID(int newC_SalesRegion_ID)
{
C_SalesRegion_ID = newC_SalesRegion_ID;
m_changed = true;
}
public int getC_SalesRegion_ID()
{
return C_SalesRegion_ID;
}
public void setC_Project_ID(int newC_Project_ID)
{
C_Project_ID = newC_Project_ID;
m_changed = true;
}
public int getC_Project_ID()
{
return C_Project_ID;
}
public void setC_Campaign_ID(int newC_Campaign_ID)
{
C_Campaign_ID = newC_Campaign_ID;
m_changed = true;
}
public int getC_Campaign_ID()
{
return C_Campaign_ID;
}
public void setC_Activity_ID(int newC_Activity_ID)
{
C_Activity_ID = newC_Activity_ID;
m_changed = true;
}
public int getC_Activity_ID()
{
return C_Activity_ID;
}
public void setUser1_ID(int newUser1_ID)
{
User1_ID = newUser1_ID;
m_changed = true;
}
public int getUser1_ID()
{
return User1_ID;
}
public void setUser2_ID(int newUser2_ID)
{
User2_ID = newUser2_ID;
m_changed = true;
}
public int getUser2_ID()
{
return User2_ID;
}
public boolean isChanged()
{
return m_changed;
}
private void writeObject(ObjectOutputStream oos) throws IOException
{
oos.defaultWriteObject();
}
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
{
ois.defaultReadObject();
}
} // Account
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -