public final class SplitTxn extends AbstractTxn
AbstractTxn.ClearedStatusBANK_TRANSACTION_TYPE, PRINT_CHECKNUM_PREFIX, PRINT_CHECKNUM_SUFFIX, SPLIT_TRANSACTION_TYPE, STATUS_CLEARED, STATUS_RECONCILING, STATUS_UNRECONCILED, syncID, TAG_FI_ID, TAG_FITID_PREFIX, TAG_INVST_SPLIT_EXP, TAG_INVST_SPLIT_FEE, TAG_INVST_SPLIT_INC, TAG_INVST_SPLIT_SEC, TAG_INVST_SPLIT_TYPE, TAG_INVST_SPLIT_XFR, TAG_IS_NEW_TXN, TAG_ONLINE_PMT_ID, TAG_QIF_IMPORT_SESSION, TAG_QIF_INVST_ACTION, TAG_RECON_ASOFDT, TAG_RECON_DATE, TAG_SPLIT_ADDED, TAG_SPLIT_AMOUNT, TAG_SPLIT_CALC, TAG_SPLIT_PAIR, TRANSFER_TYPE_BANK, TRANSFER_TYPE_BUYSELL, TRANSFER_TYPE_BUYSELLXFR, TRANSFER_TYPE_DIVIDEND, TRANSFER_TYPE_DIVIDENDXFR, TRANSFER_TYPE_MISCINCEXP, TRANSFER_TYPE_SHORTCOVERbook, info| Constructor and Description |
|---|
SplitTxn(ParentTxn parentTxn)
Creates a SplitTxn attached to the given ParentTxn
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteItem()
Deletes this item by removing it from the parent.
|
long |
getAmount()
Get the amount of this transaction in terms of the
currency of the parent transaction.
|
java.lang.String |
getCheckNumber()
Get the checknumber associated with this transaction.
|
long |
getDateEntered()
Get the date that this transaction was entered.
|
int |
getDateInt()
Get the date of this transaction
|
Txn |
getFlipSide()
Return the 'flip side' of this split transaction.
|
AbstractTxn |
getOtherTxn(int i)
Return the "other transaction" for this split.
|
int |
getOtherTxnCount()
Return the number of "other transactions".
|
long |
getParentAmount()
Get the amount of this transaction in terms of the
currency of the parent transaction.
|
ParentTxn |
getParentTxn()
Get the ParentTxn for which this is a split.
|
long |
getParentValue()
Get the amount of this transaction in terms of the
currency of the parent transaction.
|
double |
getRate()
Get the rate for the transaction.
|
int |
getTaxDateInt()
Get the date of this transaction for tax purposes.
|
java.lang.String |
getTransferType()
Get the type of transaction.
|
long |
getValue()
Get the amount that this transaction affects the account of the this transaction.
|
protected boolean |
isSyncable() |
boolean |
isTransferTo(Account acct)
Check whether or not this transaction includes a transfer
to the given account.
|
protected void |
itemWasUpdated()
This is called after an item is updated by calling itemWasUpdated(SyncRecord).
|
protected void |
itemWillSync()
This is called just before an item will be stored and/or synced when itemWillSync(SyncRecord)
is called.
|
static SplitTxn |
makeSplitTxn(ParentTxn parentTxn,
long parentAmount,
double rate,
Account account,
java.lang.String description,
long txnId,
byte status)
Deprecated.
please use the other makeSplitTxn call as the amounts will not be subject to floating point inaccuracies
|
static SplitTxn |
makeSplitTxn(ParentTxn parentTxn,
long parentAmount,
long splitAmount,
double rate,
Account account,
java.lang.String description,
long txnId,
byte status)
Creates a SplitTxn with the parentAmount having a negative effect on the
account of parentTxn, and splitAmount having a positive effect on the
account of this SplitTxn.
|
void |
negateAmount()
Reverses the sign of the amount of the split
|
void |
setAmount(long splitAmount)
Set the amount that this split affects the -other- side of the transaction.
|
void |
setAmount(long newSplitAmount,
double newRate,
long newParentAmount)
Set the amounts for this transaction, including the amount of the
transaction in the split account, the rate, and the amount of the
transaction in the account of the parent transaction.
|
void |
setAmount(long newSplitAmount,
long newParentAmount)
Set the amounts for this transaction, including the amount of the
transaction in the split account, and the amount of the transaction
in the account of the parent transaction.
|
void |
setCheckNumber(java.lang.String newCheckNumber) |
void |
setParentAmount(double newRate,
long newParentAmount)
Set the amount of the transaction in the parent account.
|
void |
takeAmounts(SplitTxn split)
Take the amount and rates from the given split.
|
void |
takeValuesFrom(SplitTxn otherTxn) |
java.lang.String |
toString() |
autoSyncsChanges, getAccount, getAddress, getAttachmentKeys, getAttachmentTag, getCheckNumAsInt, getClearedStatus, getDescription, getFIID, getFiTxnId, getOldTxnID, getStatus, getStatusChar, getTags, hasAttachments, isDirty, isNew, loadFromStorage, needsToBePrinted, removeAttachmentTag, resetDirty, setAccount, setAttachmentTag, setClearedStatus, setDescription, setDirty, setFIID, setFiTxnId, setIsNew, setStatus, wasDownloadedaddParameters, addTags, decodeKeywordList, doesParameterExist, duplicate, encodeKeywordList, equals, getAccountParameter, getAddressParameter, getBook, getBooleanParameter, getCurrencyParameter, getDoubleParameter, getIntParameter, getKeywords, getLongParameter, getParameter, getParameter, getParameterCount, getParameterKeys, getPreference, getPreferenceBoolean, getPreferenceDouble, getPreferenceInt, getPreferenceIntArray, getPreferenceLong, getPreferenceStringList, getPreferenceSublist, getPreferenceSubset, getSyncInfo, getSyncItemType, getSyncTimestamp, getUUID, hashCode, hasKeywordSubstring, initialize, isInEditingMode, itemWasUpdated, itemWillSync, makeSyncableItem, removeParameter, setAccountParameter, setAddress, setAddressParameter, setCurrencyParameter, setEditingMode, setKeywords, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterNoNotify, setPreference, setPreference, setPreference, syncItemclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetKeywords, getParameter, getParameterpublic SplitTxn(ParentTxn parentTxn)
protected boolean isSyncable()
isSyncable in class MoneydanceSyncableItemprotected void itemWasUpdated()
MoneydanceSyncableItemitemWasUpdated in class AbstractTxnprotected void itemWillSync()
MoneydanceSyncableItemitemWillSync in class AbstractTxnpublic boolean deleteItem()
deleteItem in class MoneydanceSyncableItempublic ParentTxn getParentTxn()
getParentTxn in interface TxngetParentTxn in class AbstractTxnpublic long getDateEntered()
getDateEntered in interface TxngetDateEntered in class AbstractTxnpublic int getDateInt()
getDateInt in interface TxngetDateInt in class AbstractTxnpublic int getTaxDateInt()
getTaxDateInt in interface TxngetTaxDateInt in class AbstractTxnpublic long getParentAmount()
public long getParentValue()
public long getAmount()
public long getValue()
getValue in interface TxngetValue in class AbstractTxnpublic boolean isTransferTo(Account acct)
isTransferTo in interface TxnisTransferTo in class AbstractTxnpublic double getRate()
public java.lang.String getTransferType()
getTransferType in interface TxngetTransferType in class AbstractTxnpublic void setParentAmount(double newRate,
long newParentAmount)
public void negateAmount()
public void takeAmounts(SplitTxn split)
public final void takeValuesFrom(SplitTxn otherTxn)
public void setAmount(long newSplitAmount,
long newParentAmount)
public void setAmount(long newSplitAmount,
double newRate,
long newParentAmount)
public void setAmount(long splitAmount)
public final java.lang.String getCheckNumber()
AbstractTxngetCheckNumber in interface TxngetCheckNumber in class AbstractTxnpublic final void setCheckNumber(java.lang.String newCheckNumber)
public int getOtherTxnCount()
getOtherTxnCount in interface TxngetOtherTxnCount in class AbstractTxnpublic AbstractTxn getOtherTxn(int i)
getOtherTxn in interface TxngetOtherTxn in class AbstractTxnpublic Txn getFlipSide()
public java.lang.String toString()
toString in class java.lang.Objectpublic static SplitTxn makeSplitTxn(ParentTxn parentTxn, long parentAmount, long splitAmount, double rate, Account account, java.lang.String description, long txnId, byte status)
public static SplitTxn makeSplitTxn(ParentTxn parentTxn, long parentAmount, double rate, Account account, java.lang.String description, long txnId, byte status)