Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NextTransaction ¶
func NextTransaction(imports []Flattened) (*Transaction, []Flattened, error)
NextTransaction creates the next transaction from a series of imports, returns that, as well as the remaining imports.
func SortTransactions ¶
func SortTransactions(transactions []*Transaction)
Types ¶
type Flattened ¶
type Flattened struct { SrcFile string BegLine int Date time.Time Code string // optional. The thing in parentheses. e.g. check # Payee string TransNotes []string // optional. notes that apply to the entire transaction. PostingBegLine int Account string Currency string // must be "$" for now Amount big.Float State rune // optional PostingNotes []string // optional }
Flattened is meant as an aid to importing transactions from csv, where postings are flattened together with a transaction and appear on the same line. Contains all the fields from Transaction and from Posting.
type Message ¶
type Message struct { Date string To string From string Subject string TextPlain string TextHTML string }
Message represents a single email message
func NewMessage ¶
NewMessage creates a new message
type Posting ¶
type Posting struct { BegLine int Account string Currency string Amount big.Float State rune Notes []string Xact *Transaction }
Posting represents a change to an account, along with associated metadata.
func (*Posting) AmountText ¶
AmountText returns the currency and amount in a text format.
type Transaction ¶
type Transaction struct { SrcFile string // may not be set BegLine int // may not be set Date time.Time Code string // may not be set. The thing in parentheses. e.g. check # Payee string Notes []string // may not be set Postings []*Posting }
Transaction is group of related Postings, with an optional shared comment.
func SyntheticTransaction ¶
func SyntheticTransaction(date time.Time, code, payee string, notes []string, amountText, costAccount, paymentAccount string) (*Transaction, error)
SyntheticTransaction creates a new Transaction
func (*Transaction) DateText ¶
func (t *Transaction) DateText() string
func (*Transaction) LinkPostings ¶
func (t *Transaction) LinkPostings() *Transaction
LinkPostings points all postings back to their parent transaction and returns a pointer to that transaction.
func (*Transaction) String ¶
func (t *Transaction) String() string