Class ParentTxn
java.lang.Object
com.infinitekind.moneydance.model.MoneydanceSyncableItem
com.infinitekind.moneydance.model.AbstractTxn
com.infinitekind.moneydance.model.ParentTxn
- All Implemented Interfaces:
Txn
,com.infinitekind.tiksync.SyncableItem
public final class ParentTxn extends AbstractTxn implements com.infinitekind.tiksync.SyncableItem
Concrete class that represents the "source" side of a transaction.
Valid transactions of this type are associated with one or more
destination (or split) transactions. The value of transactions of
this type are the sum of the values of all of the associated splits.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.infinitekind.moneydance.model.AbstractTxn
AbstractTxn.ClearedStatus
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SYNCABLE_TYPE_VALUE
Fields inherited from class com.infinitekind.moneydance.model.AbstractTxn
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_INVST_TXN_TYPE, 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
Fields inherited from class com.infinitekind.moneydance.model.MoneydanceSyncableItem
book, info, SECURITY_SUBTYPES_ITEM_TYPE
-
Constructor Summary
Constructors Constructor Description ParentTxn(AccountBook book)
-
Method Summary
Modifier and Type Method Description void
addSplit(SplitTxn newSplit)
Add a "split" to this transaction.ParentTxn
duplicate()
Clone this transaction and all of its splits.ParentTxn
duplicateAsNew()
Create a new transaction with all of the same core fields as this transaction.java.lang.String
getCheckNumber()
Get the check number associated with this transaction.long
getDateEntered()
Get the date that this transaction was entered.int
getDateInt()
Return the date encoded as an integer with decimal form YYYYMMDDInvestTxnType
getInvestTxnType()
Return the type of transaction (buy, sell, transfer, dividend, bank/transfer, etc)java.lang.String
getMemo()
Get the memo associated with this transaction.AbstractTxn
getOtherTxn(int i)
Return the "other transaction" at the specified index.int
getOtherTxnCount()
Return the number of "other transactions".ParentTxn
getParentTxn()
Get the ParentTxn of this transfer.SplitTxn
getSplit(int i)
Return the split for this transaction at the given index.int
getSplitCount()
Return the number of splits for this transaction.java.lang.String
getSyncItemType()
Subclasses should override this to return a static string identifying their type of objectint
getTaxDateInt()
Return the tax date encoded as an integer with decimal form YYYYMMDDjava.lang.String
getTransferType()
Get the type of transfer.long
getValue()
Get the value of this transaction in the currency assigned to the account that is associated with this transaction.int
indexOfSplit(SplitTxn sTxn)
Get the index of the specified split, or -1 if the split is not associated with this transaction.boolean
isDirty()
Returns true if this transaction has been modified since it was last saved.boolean
isTransferTo(Account acct)
Check whether or not this transaction includes a transfer to the given account.void
itemWasUpdated()
This is called after an item is updated by calling itemWasUpdated(SyncRecord).void
itemWillSync()
This is called just before an item will be stored and/or synced when itemWillSync(SyncRecord) is called.static ParentTxn
makeParentTxn(AccountBook book, int date, int taxDate, long dateEntered, java.lang.String checkNumber, Account account, java.lang.String description, java.lang.String memo, long id, byte status)
Shortcut to create a ParentTxn object.boolean
removeSplit(int sTxnIdx)
Remove the split at the specified index.boolean
removeSplit(SplitTxn splitToRemove)
Remove the specified split.void
setCheckNumber(java.lang.String newCheckNumber)
Set the check number associated with this transaction.void
setDateEntered(long newDateEntered)
Set the date that this transaction was entered.void
setDateInt(int newDate)
Set the date (encoded as an int with decimal form YYYYMMDD) associated with this transaction.void
setInvestTxnType(InvestTxnType txnType)
Set the transaction type (buy, sell, dividend, bank, etc) for this transactionvoid
setMemo(java.lang.String newMemo)
Set the memo associated with this transaction.void
setTaxDateInt(int newDate)
Set the tax date (encoded as an int with decimal form YYYYMMDD) associated with this transaction.void
setTransferType(java.lang.String type)
Deprecated.please use set/getInvestTxnType()java.lang.String
toMultilineString()
java.lang.String
toString()
Methods inherited from class com.infinitekind.moneydance.model.AbstractTxn
autoSyncsChanges, getAccount, getAddress, getAttachmentKeys, getAttachmentTag, getCheckNumAsInt, getCheckNumAsLong, getClearedStatus, getDatePostedOnline, getDescription, getFIID, getFiTxnId, getOldTxnID, getOriginalOnlineTxn, getStatus, getStatusChar, getTags, hasAttachments, isNew, loadFromStorage, needsToBePrinted, removeAttachmentTag, resetDirty, setAccount, setAttachmentTag, setClearedStatus, setDescription, setDirty, setFIID, setFiTxnId, setIsNew, setOriginalOnlineTxn, setStatus, wasDownloaded
Methods inherited from class com.infinitekind.moneydance.model.MoneydanceSyncableItem
addParameters, addTags, decodeKeywordList, deleteItem, doesParameterExist, encodeKeywordList, equals, getAccountParameter, getAddressParameter, getBook, getBooleanParameter, getCurrencyParameter, getCurrencyParameter, getCurrencyParameter, getDoubleParameter, getIntParameter, getKeywords, getLongParameter, getOriginalItem, getParameter, getParameter, getParameterCount, getParameterKeys, getPreference, getPreferenceBoolean, getPreferenceDouble, getPreferenceInt, getPreferenceIntArray, getPreferenceLong, getPreferenceStringList, getPreferenceSublist, getPreferenceSubset, getStringListParameter, getSyncInfo, getSyncTimestamp, getUUID, hasBeenSynced, hashCode, hasKeywordSubstring, initialize, isInEditingMode, isSyncable, itemWasUpdated, itemWillSync, makeSyncableItem, removeParameter, setAccountParameter, setAddress, setAddressParameter, setCurrencyParameter, setCurrencyParameter, setCurrencyParameter, setEditingMode, setKeywords, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterNoNotify, setPreference, setPreference, setPreference, syncItem
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.infinitekind.tiksync.SyncableItem
getSyncTimestamp, getUUID, itemWasUpdated, itemWillSync
Methods inherited from interface com.infinitekind.moneydance.model.Txn
getKeywords, getParameter, getParameter
-
Field Details
-
SYNCABLE_TYPE_VALUE
public static final java.lang.String SYNCABLE_TYPE_VALUE- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
itemWasUpdated
public void itemWasUpdated()Description copied from class:MoneydanceSyncableItem
This is called after an item is updated by calling itemWasUpdated(SyncRecord). This can occur from the syncing process or from being loaded locally. Override this method to be notified.- Overrides:
itemWasUpdated
in classAbstractTxn
-
itemWillSync
public void itemWillSync()Description copied from class:MoneydanceSyncableItem
This is called just before an item will be stored and/or synced when itemWillSync(SyncRecord) is called. Override this method to be notified or if you'd like to store anything into the info record to be synced.- Overrides:
itemWillSync
in classAbstractTxn
-
getSyncItemType
public final java.lang.String getSyncItemType()Description copied from class:MoneydanceSyncableItem
Subclasses should override this to return a static string identifying their type of object- Specified by:
getSyncItemType
in interfacecom.infinitekind.tiksync.SyncableItem
- Overrides:
getSyncItemType
in classMoneydanceSyncableItem
-
getDateInt
public final int getDateInt()Return the date encoded as an integer with decimal form YYYYMMDD- Specified by:
getDateInt
in interfaceTxn
- Specified by:
getDateInt
in classAbstractTxn
-
setDateInt
public final void setDateInt(int newDate)Set the date (encoded as an int with decimal form YYYYMMDD) associated with this transaction. -
getTaxDateInt
public final int getTaxDateInt()Return the tax date encoded as an integer with decimal form YYYYMMDD- Specified by:
getTaxDateInt
in interfaceTxn
- Specified by:
getTaxDateInt
in classAbstractTxn
-
setTaxDateInt
public final void setTaxDateInt(int newDate)Set the tax date (encoded as an int with decimal form YYYYMMDD) associated with this transaction. -
getDateEntered
public final long getDateEntered()Get the date that this transaction was entered.- Specified by:
getDateEntered
in interfaceTxn
- Specified by:
getDateEntered
in classAbstractTxn
-
setDateEntered
public final void setDateEntered(long newDateEntered)Set the date that this transaction was entered. -
getOtherTxnCount
public final int getOtherTxnCount()Return the number of "other transactions".- Specified by:
getOtherTxnCount
in interfaceTxn
- Specified by:
getOtherTxnCount
in classAbstractTxn
-
getParentTxn
Get the ParentTxn of this transfer.- Specified by:
getParentTxn
in interfaceTxn
- Specified by:
getParentTxn
in classAbstractTxn
-
getOtherTxn
Return the "other transaction" at the specified index.- Specified by:
getOtherTxn
in interfaceTxn
- Specified by:
getOtherTxn
in classAbstractTxn
-
isTransferTo
Check whether or not this transaction includes a transfer to the given account.- Specified by:
isTransferTo
in interfaceTxn
- Specified by:
isTransferTo
in classAbstractTxn
-
getValue
public final long getValue()Get the value of this transaction in the currency assigned to the account that is associated with this transaction.- Specified by:
getValue
in interfaceTxn
- Specified by:
getValue
in classAbstractTxn
-
isDirty
public boolean isDirty()Returns true if this transaction has been modified since it was last saved.- Overrides:
isDirty
in classAbstractTxn
-
getCheckNumber
public final java.lang.String getCheckNumber()Get the check number associated with this transaction.- Specified by:
getCheckNumber
in interfaceTxn
- Specified by:
getCheckNumber
in classAbstractTxn
-
setCheckNumber
public final void setCheckNumber(java.lang.String newCheckNumber)Set the check number associated with this transaction. -
getMemo
public final java.lang.String getMemo()Get the memo associated with this transaction. -
setMemo
public final void setMemo(java.lang.String newMemo)Set the memo associated with this transaction. -
getTransferType
public final java.lang.String getTransferType()Get the type of transfer. Usually only used in the investment register to differentiate between buy, sell, and stock split transfers.- Specified by:
getTransferType
in interfaceTxn
- Specified by:
getTransferType
in classAbstractTxn
-
setTransferType
public final void setTransferType(java.lang.String type)Deprecated.please use set/getInvestTxnType()Set the type of transfer. Usually only used in the investment register to differentiate between buy, sell, and stock split transactions. -
getInvestTxnType
Return the type of transaction (buy, sell, transfer, dividend, bank/transfer, etc)- Returns:
- The investment transaction type for this transaction
- Since:
- Moneydance 2017.7 build 1662
-
setInvestTxnType
Set the transaction type (buy, sell, dividend, bank, etc) for this transaction- Since:
- Moneydance 2017.7 build 1662
-
addSplit
Add a "split" to this transaction. This should only be called from the TransactionSet, and when reading transactions from a file or database -
getSplit
Return the split for this transaction at the given index. -
getSplitCount
public final int getSplitCount()Return the number of splits for this transaction. -
removeSplit
public final boolean removeSplit(int sTxnIdx)Remove the split at the specified index. -
removeSplit
Remove the specified split. -
indexOfSplit
Get the index of the specified split, or -1 if the split is not associated with this transaction. -
duplicate
Clone this transaction and all of its splits. This should only be used for temporarily maintaining a copy of this transaction and copying this transaction to another data file. Warning: Do *not* add this duplicate transaction back to the TransactionSet because it may cause all sorts of nasty problems.- Overrides:
duplicate
in classMoneydanceSyncableItem
-
duplicateAsNew
Create a new transaction with all of the same core fields as this transaction. but with a txn ID of -1 so that the transaction can be added back to the transaction set as a copy of this one. -
toMultilineString
public java.lang.String toMultilineString() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
makeParentTxn
public static ParentTxn makeParentTxn(AccountBook book, int date, int taxDate, long dateEntered, java.lang.String checkNumber, Account account, java.lang.String description, java.lang.String memo, long id, byte status)Shortcut to create a ParentTxn object.
-