ledgertools

package module
Version: v0.0.0-...-737f61f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2017 License: MIT Imports: 7 Imported by: 0

README

Ledger Tools

Build Status

importing tasks still to be done

  • automated and benchmark tests for register import
  • See if we can solve the notes problem for register import
  • Take a look at converting register import to a streaming system
  • instead of converting csv to csv, convert it directly into ledger format
  • recognize existing entries that make for duplicates. Prefer email import to csv import
  • handle Patreon emails. from bingo@patreon.com. subject 'Thank you for supporting your creators!'
  • handle apple itunes emails
  • handle long tall sally emails. from: 'customerservices@longtallsally.com'. Subject like: 'About your order...'. need to parse html. They don't send text/plain parts!
  • handle asos orders. from: 'order_confirm@asos.com'. subject like: 'Thanks for your order!'. looks like I need to parse html again. possibly double-base64 encoded.

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.

func NewFlattened

func NewFlattened(srcFile string, begLine int, date time.Time, code string, payee string, transNotes []string, postingBegLine int, account string, currency string, amount big.Float, state rune, postingNotes []string) Flattened

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

func NewMessage(date, to, from, subject, textPlain, textHTML string) Message

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

func (p *Posting) AmountText() string

AmountText returns the currency and amount in a text format.

func (*Posting) String

func (p *Posting) String() string

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

Directories

Path Synopsis
cmd
csv
ops
mailimp
Package mailimp provides helpers for email importers
Package mailimp provides helpers for email importers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL