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.StringSYNCABLE_TYPE_VALUEFields 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_SHORTCOVERFields 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 voidaddSplit(SplitTxn newSplit)Add a "split" to this transaction.ParentTxnduplicate()Clone this transaction and all of its splits.ParentTxnduplicateAsNew()Create a new transaction with all of the same core fields as this transaction.java.lang.StringgetCheckNumber()Get the check number associated with this transaction.longgetDateEntered()Get the date that this transaction was entered.intgetDateInt()Return the date encoded as an integer with decimal form YYYYMMDDInvestTxnTypegetInvestTxnType()Return the type of transaction (buy, sell, transfer, dividend, bank/transfer, etc)java.lang.StringgetMemo()Get the memo associated with this transaction.AbstractTxngetOtherTxn(int i)Return the "other transaction" at the specified index.intgetOtherTxnCount()Return the number of "other transactions".ParentTxngetParentTxn()Get the ParentTxn of this transfer.SplitTxngetSplit(int i)Return the split for this transaction at the given index.intgetSplitCount()Return the number of splits for this transaction.java.lang.StringgetSyncItemType()Subclasses should override this to return a static string identifying their type of objectintgetTaxDateInt()Return the tax date encoded as an integer with decimal form YYYYMMDDjava.lang.StringgetTransferType()Get the type of transfer.longgetValue()Get the value of this transaction in the currency assigned to the account that is associated with this transaction.intindexOfSplit(SplitTxn sTxn)Get the index of the specified split, or -1 if the split is not associated with this transaction.booleanisDirty()Returns true if this transaction has been modified since it was last saved.booleanisTransferTo(Account acct)Check whether or not this transaction includes a transfer to the given account.voiditemWasUpdated()This is called after an item is updated by calling itemWasUpdated(SyncRecord).voiditemWillSync()This is called just before an item will be stored and/or synced when itemWillSync(SyncRecord) is called.static ParentTxnmakeParentTxn(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.booleanremoveSplit(int sTxnIdx)Remove the split at the specified index.booleanremoveSplit(SplitTxn splitToRemove)Remove the specified split.voidsetCheckNumber(java.lang.String newCheckNumber)Set the check number associated with this transaction.voidsetDateEntered(long newDateEntered)Set the date that this transaction was entered.voidsetDateInt(int newDate)Set the date (encoded as an int with decimal form YYYYMMDD) associated with this transaction.voidsetInvestTxnType(InvestTxnType txnType)Set the transaction type (buy, sell, dividend, bank, etc) for this transactionvoidsetMemo(java.lang.String newMemo)Set the memo associated with this transaction.voidsetTaxDateInt(int newDate)Set the tax date (encoded as an int with decimal form YYYYMMDD) associated with this transaction.voidsetTransferType(java.lang.String type)Deprecated.please use set/getInvestTxnType()java.lang.StringtoMultilineString()java.lang.StringtoString()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, wasDownloadedMethods 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, syncItemMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.infinitekind.tiksync.SyncableItem
getSyncTimestamp, getUUID, itemWasUpdated, itemWillSyncMethods 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:MoneydanceSyncableItemThis 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:
itemWasUpdatedin classAbstractTxn
-
itemWillSync
public void itemWillSync()Description copied from class:MoneydanceSyncableItemThis 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:
itemWillSyncin classAbstractTxn
-
getSyncItemType
public final java.lang.String getSyncItemType()Description copied from class:MoneydanceSyncableItemSubclasses should override this to return a static string identifying their type of object- Specified by:
getSyncItemTypein interfacecom.infinitekind.tiksync.SyncableItem- Overrides:
getSyncItemTypein classMoneydanceSyncableItem
-
getDateInt
public final int getDateInt()Return the date encoded as an integer with decimal form YYYYMMDD- Specified by:
getDateIntin interfaceTxn- Specified by:
getDateIntin 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:
getTaxDateIntin interfaceTxn- Specified by:
getTaxDateIntin 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:
getDateEnteredin interfaceTxn- Specified by:
getDateEnteredin 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:
getOtherTxnCountin interfaceTxn- Specified by:
getOtherTxnCountin classAbstractTxn
-
getParentTxn
Get the ParentTxn of this transfer.- Specified by:
getParentTxnin interfaceTxn- Specified by:
getParentTxnin classAbstractTxn
-
getOtherTxn
Return the "other transaction" at the specified index.- Specified by:
getOtherTxnin interfaceTxn- Specified by:
getOtherTxnin classAbstractTxn
-
isTransferTo
Check whether or not this transaction includes a transfer to the given account.- Specified by:
isTransferToin interfaceTxn- Specified by:
isTransferToin 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:
getValuein interfaceTxn- Specified by:
getValuein classAbstractTxn
-
isDirty
public boolean isDirty()Returns true if this transaction has been modified since it was last saved.- Overrides:
isDirtyin classAbstractTxn
-
getCheckNumber
public final java.lang.String getCheckNumber()Get the check number associated with this transaction.- Specified by:
getCheckNumberin interfaceTxn- Specified by:
getCheckNumberin 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:
getTransferTypein interfaceTxn- Specified by:
getTransferTypein 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:
duplicatein 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:
toStringin 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.
-