|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjgnash.engine.TransactionEntry
public class TransactionEntry
Transaction Entry
Each Transaction entry has an amount for the credit and debit side of the transaction. When the debit and credit account has the same currency, one amount will be the negated value of the other. If the credit and debit accounts do not have the same currency then the amounts will be different to represent the exchanged value at the time of the transaction. If the entry is to be used as an "single entry / adjustment" transaction, then the credit and debit account must be set to the same account and the credit and debit amounts must be set to the same value.
| Field Summary | |
|---|---|
private TransactionTag |
cachedTransactionTag
|
private Account |
creditAccount
Account with balance being increased |
private java.math.BigDecimal |
creditAmount
|
private ReconciledState |
creditReconciled
Reconciled state of the transaction |
private Account |
debitAccount
Account with balance being decreased |
private java.math.BigDecimal |
debitAmount
|
private ReconciledState |
debitReconciled
Reconciled state of the debit side of the transaction |
private java.lang.String |
memo
Memo for this entry |
private java.lang.String |
transactionTag
|
| Constructor Summary | |
|---|---|
|
TransactionEntry()
Public constructor |
protected |
TransactionEntry(Account creditAccount,
Account debitAccount,
java.math.BigDecimal amount)
Simple constructor for a double entry transaction |
protected |
TransactionEntry(Account creditAccount,
Account debitAccount,
java.math.BigDecimal creditAmount,
java.math.BigDecimal debitAmount)
Simple constructor for a double entry transaction with exchange rate |
|
TransactionEntry(Account account,
java.math.BigDecimal amount)
Simple constructor for a single entry transaction |
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
int |
compareTo(TransactionEntry entry)
|
boolean |
equals(java.lang.Object entry)
|
(package private) boolean |
equals(TransactionEntry entry)
Reconciled state is ignored |
java.math.BigDecimal |
getAmount(Account account)
|
Account |
getCreditAccount()
|
java.math.BigDecimal |
getCreditAmount()
|
(package private) ReconciledState |
getCreditReconciled()
|
Account |
getDebitAccount()
|
java.math.BigDecimal |
getDebitAmount()
|
(package private) ReconciledState |
getDebitReconciled()
|
java.lang.String |
getMemo()
|
ReconciledState |
getReconciled(Account account)
|
TransactionTag |
getTransactionTag()
|
int |
hashCode()
|
boolean |
isSingleEntry()
Check to determine is this is a single entry transaction |
void |
setAmount(java.math.BigDecimal amount)
Shortcut method to set credit and debit amounts |
void |
setCreditAccount(Account creditAccount)
|
void |
setCreditAmount(java.math.BigDecimal amount)
|
(package private) void |
setCreditReconciled(ReconciledState creditReconciled)
|
void |
setDebitAccount(Account debitAccount)
|
void |
setDebitAmount(java.math.BigDecimal debitAmount)
|
(package private) void |
setDebitReconciled(ReconciledState debitReconciled)
|
void |
setMemo(java.lang.String memo)
Sets the memo for the entry |
void |
setReconciled(Account account,
ReconciledState reconciled)
|
void |
setTransactionTag(TransactionTag transactionTag)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String transactionTag
private transient TransactionTag cachedTransactionTag
private Account debitAccount
private Account creditAccount
private java.math.BigDecimal creditAmount
private java.math.BigDecimal debitAmount
private ReconciledState creditReconciled
private ReconciledState debitReconciled
private java.lang.String memo
| Constructor Detail |
|---|
public TransactionEntry()
public TransactionEntry(Account account,
java.math.BigDecimal amount)
account - account for the transactionamount - amount for the transaction
protected TransactionEntry(Account creditAccount,
Account debitAccount,
java.math.BigDecimal amount)
creditAccount - credit account for the transactiondebitAccount - debit account for the transactionamount - amount for the transaction
protected TransactionEntry(Account creditAccount,
Account debitAccount,
java.math.BigDecimal creditAmount,
java.math.BigDecimal debitAmount)
creditAccount - credit account for the transactiondebitAccount - debit account for the transactioncreditAmount - amount for the transactiondebitAmount - amount for the transaction| Method Detail |
|---|
public java.math.BigDecimal getCreditAmount()
public java.math.BigDecimal getAmount(Account account)
public void setAmount(java.math.BigDecimal amount)
amount - credit amount of the transactionpublic Account getCreditAccount()
ReconciledState getCreditReconciled()
public Account getDebitAccount()
ReconciledState getDebitReconciled()
public java.lang.String getMemo()
public ReconciledState getReconciled(Account account)
public void setCreditAmount(java.math.BigDecimal amount)
public void setCreditAccount(Account creditAccount)
void setCreditReconciled(ReconciledState creditReconciled)
public void setDebitAccount(Account debitAccount)
void setDebitReconciled(ReconciledState debitReconciled)
public void setMemo(java.lang.String memo)
memo - new memo
public void setReconciled(Account account,
ReconciledState reconciled)
public java.math.BigDecimal getDebitAmount()
public void setDebitAmount(java.math.BigDecimal debitAmount)
public int compareTo(TransactionEntry entry)
compareTo in interface java.lang.Comparable<TransactionEntry>public boolean equals(java.lang.Object entry)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectboolean equals(TransactionEntry entry)
entry - transaction entry to compare
public boolean isSingleEntry()
true if this is a single entry TransactionEntrypublic void setTransactionTag(TransactionTag transactionTag)
public TransactionTag getTransactionTag()
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||