public final class SplitTxn extends AbstractTxn
AbstractTxn.ClearedStatus
BANK_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_SHORTCOVER
book, 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, wasDownloaded
addParameters, 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, syncItem
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getKeywords, getParameter, getParameter
public SplitTxn(ParentTxn parentTxn)
protected boolean isSyncable()
isSyncable
in class MoneydanceSyncableItem
protected void itemWasUpdated()
MoneydanceSyncableItem
itemWasUpdated
in class AbstractTxn
protected void itemWillSync()
MoneydanceSyncableItem
itemWillSync
in class AbstractTxn
public boolean deleteItem()
deleteItem
in class MoneydanceSyncableItem
public ParentTxn getParentTxn()
getParentTxn
in interface Txn
getParentTxn
in class AbstractTxn
public long getDateEntered()
getDateEntered
in interface Txn
getDateEntered
in class AbstractTxn
public int getDateInt()
getDateInt
in interface Txn
getDateInt
in class AbstractTxn
public int getTaxDateInt()
getTaxDateInt
in interface Txn
getTaxDateInt
in class AbstractTxn
public long getParentAmount()
public long getParentValue()
public long getAmount()
public long getValue()
getValue
in interface Txn
getValue
in class AbstractTxn
public boolean isTransferTo(Account acct)
isTransferTo
in interface Txn
isTransferTo
in class AbstractTxn
public double getRate()
public java.lang.String getTransferType()
getTransferType
in interface Txn
getTransferType
in class AbstractTxn
public 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()
AbstractTxn
getCheckNumber
in interface Txn
getCheckNumber
in class AbstractTxn
public final void setCheckNumber(java.lang.String newCheckNumber)
public int getOtherTxnCount()
getOtherTxnCount
in interface Txn
getOtherTxnCount
in class AbstractTxn
public AbstractTxn getOtherTxn(int i)
getOtherTxn
in interface Txn
getOtherTxn
in class AbstractTxn
public Txn getFlipSide()
public java.lang.String toString()
toString
in class java.lang.Object
public 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)