ofx4js
Version:
A javascript OFX library, ported from OFX4J
375 lines (374 loc) • 13.9 kB
TypeScript
import { InvestmentTransaction } from "./InvestmentTransaction";
import { SecurityId } from "../../seclist/SecurityId";
import { OriginalCurrency } from "./OriginalCurrency";
import { SubAccountType } from "../accounts/SubAccountType";
import { Inv401KSource } from "../positions/Inv401KSource";
/**
* Sell investment transaction aggregate ("INVSELL").
* @see "Section 13.9.2.4.3, OFX Spec"
*/
export declare class SellInvestmentTransaction {
private investmentTransaction;
private securityId;
private units;
private unitPrice;
private markdown;
private commission;
private taxes;
private fees;
private load;
private withholding;
private taxExempt;
private total;
private gain;
private currencyCode;
private originalCurrencyInfo;
private subAccountSecurity;
private subAccountFund;
private loanId;
private stateWithholding;
private penalty;
private inv401kSource;
/**
* Gets the investment transaction child aggregate.
*
* @return the investment transaction child aggregate
*/
getInvestmentTransaction(): InvestmentTransaction;
/**
* Sets the investment transaction child aggregate.
*
* @param investmentTransaction the investment transaction child aggregate
*/
setInvestmentTransaction(investmentTransaction: InvestmentTransaction): void;
/**
* Gets the id of the security that was sold. This is a required field according to the OFX
* spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the security id of the security that was sold
*/
getSecurityId(): SecurityId;
/**
* Sets the id of the security that was sold. This is a required field according to the OFX
* spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param securityId the security id of the security that was sold
*/
setSecurityId(securityId: SecurityId): void;
/**
* Gets the number of units of the security that was sold. For security-based actions other
* than stock splits, this is the quantity sold. For stocks, mutual funds, and others, this
* is the number of shares. For bonds, this is the face value. For options, this is the number of
* contacts. This is a required field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the number of units sold
*/
getUnits(): number;
/**
* Sets the number of units of the security that was sold. For security-based actions other
* than stock splits, this is the quantity sold. For stocks, mutual funds, and others, this
* is the number of shares. For bonds, this is the face value. For options, this is the number of
* contacts. This is a required field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param units the number of units sold
*/
setUnits(units: number): void;
/**
* Gets the price per commonly-quoted unit. For stocks, mutual funds, and others, this is the
* share price. For bonds, this is the percentage of par. For options, this is the per share (not
* per contact) price. This is a required field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the per unit price
*/
getUnitPrice(): number;
/**
* Sets the price per commonly-quoted unit. For stocks, mutual funds, and others, this is the
* share price. For bonds, this is the percentage of par. For options, this is the per share (not
* per contact) price. This is a required field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param unitPrice the per unit price
*/
setUnitPrice(unitPrice: number): void;
/**
* Gets the portion of the unit price that is attributed to the dealer markdown. This is an
* optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the per unit markedown price
*/
getMarkdown(): number;
/**
* Sets the portion of the unit price that is attributed to the dealer markdown. This is an
* optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param markdown the per unit markedown price
*/
setMarkdown(markdown: number): void;
/**
* Gets the transaction commission for the sale. This is an optional field according to the
* OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the transaction commision
*/
getCommission(): number;
/**
* Sets the transaction commission for the sale. This is an optional field according to the
* OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param commission the transaction commision
*/
setCommission(commission: number): void;
/**
* Gets the taxes for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the transaction taxes
*/
getTaxes(): number;
/**
* Sets the taxes for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param taxes the transaction taxes
*/
setTaxes(taxes: number): void;
/**
* Gets the fees for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the transaction fees
*/
getFees(): number;
/**
* Sets the fees for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param fees the transaction fees
*/
setFees(fees: number): void;
/**
* Gets the load for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the load
*/
getLoad(): number;
/**
* Sets the load for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param load the load
*/
setLoad(load: number): void;
/**
* Gets the withholding for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the withholding
*/
getWithholding(): number;
/**
* Sets the withholding for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param withholding the withholding
*/
setWithholding(withholding: number): void;
/**
* Gets whether the sale was tax exempt. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return whether the transaction was tax exempt
*/
getTaxExempt(): boolean;
/**
* Sets whether the sale was tax exempt. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param taxExempt whether the transaction was tax exempt
*/
setTaxExempt(taxExempt: boolean): void;
/**
* Gets the total for the sale. Should be equal to
* (units * (unitPrice + markdown)) + (commision + fees + load + taxes + penalty + withholding +
* statewithholding) according to the OFX spec. This is a required field according to the OFX
* spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the total
*/
getTotal(): number;
/**
* Sets the total for the sale. Should be equal to
* (units * (unitPrice + markdown)) + (commision + fees + load + taxes + penalty + withholding +
* statewithholding) according to the OFX spec. This is a required field according to the OFX
* spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param total the total
*/
setTotal(total: number): void;
/**
* Gets the gain sale. This is aan optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the gain for the sale
*/
getGain(): number;
/**
* Sets the gain sale. This is aan optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param gain the gain for the sale
*/
setGain(gain: number): void;
/**
* Gets the currency code for the transaction. Only one of currency code or original currency
* code should be set according to the OFX spec. If neither are set, means the default currency.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the currency code for the transaction
*/
getCurrencyCode(): string;
/**
* sets the currency code for the transaction. Only one of currency code or original currency
* code should be set according to the OFX spec. If neither are set, means the default currency.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param currencyCode the currency code for the transaction
*/
setCurrencyCode(currencyCode: string): void;
/**
* Gets the original currency info for the transaction.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the original currency info for the transaction
*/
getOriginalCurrencyInfo(): OriginalCurrency;
/**
* Sets the original currency info for the transaction.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param originalCurrencyInfo the original currency info for the transaction
*/
setOriginalCurrencyInfo(originalCurrencyInfo: OriginalCurrency): void;
/**
* Gets the sub account type for the security (e.g. CASH, MARGIN, SHORT, OTHER).
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the sub account type
*/
getSubAccountSecurity(): string;
/**
* Sets the sub account type for the security (e.g. CASH, MARGIN, SHORT, OTHER).
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param subAccountSecurity the sub account type
*/
setSubAccountSecurity(subAccountSecurity: string): void;
/**
* Gets the result of getSubAccountSecurity as one of the well-known types.
*
* @return the type of null if it wasn't one of the well known types.
*/
getSubAccountSecurityEnum(): SubAccountType;
/**
* Gets the sub account type that the security is being transfered from
* (e.g. CASH, MARGIN, SHORT, OTHER).
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the sub account fund
*/
getSubAccountFund(): string;
/**
* Sets the sub account type that the security is being transfered from
* (e.g. CASH, MARGIN, SHORT, OTHER).
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param subAccountFund the sub account fund
*/
setSubAccountFund(subAccountFund: string): void;
/**
* Gets the result of getSubAccountFund as one of the well-known types.
*
* @return the type of null if it wasn't one of the well known types
*/
getSubAccountFundEnum(): SubAccountType;
/**
* Gets the loan id if this transaction was due to a loan or loan repayment on a 401k. This is an
* optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the loan id
*/
getLoanId(): string;
/**
* Sets the loan id if this transaction was due to a loan or loan repayment on a 401k. This is an
* optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param loanId the loan id
*/
setLoanId(loanId: string): void;
/**
* Gets the state withholding for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the state withholding
*/
getStateWithholding(): number;
/**
* Sets the state withholding for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param stateWithholding the state withholding
*/
setStateWithholding(stateWithholding: number): void;
/**
* Gets the penalty for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the state withholding
*/
getPenalty(): number;
/**
* Sets the penalty for the sale. This is an optional field according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param penalty the state withholding
*/
setPenalty(penalty: number): void;
/**
* Gets the 401K source for the sale. Should be one of "PRETAX", "AFTERTAX", "MATCH",
* "PROFITSHARING", "ROLLOVER", "OTHERVEST", "OTHERNONVEST". This is an optional field
* according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the 401k source
*/
get401kSource(): string;
/**
* Sets the 401K source for the sale. Should be one of "PRETAX", "AFTERTAX", "MATCH",
* "PROFITSHARING", "ROLLOVER", "OTHERVEST", "OTHERNONVEST". This is an optional field
* according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param inv401kSource the 401k source
*/
set401kSource(inv401kSource: string): void;
/**
* Gets the 401k source as one of the well-known types.
*
* @return the 401k source or null if its not one of the well-known types
*/
get401kSourceEnum(): Inv401KSource;
}