Documentation ¶
Index ¶
- Variables
- type Database
- func (d Database) AllocateTransactions(cats map[int]TransactionCategory) error
- func (d Database) Close()
- func (d Database) GetAll(limit, page int) ([]Transaction, error)
- func (d Database) GetExpensesSince(accountingDateStart time.Time, accountingDateEnd time.Time) (float64, error)
- func (d Database) GetMovedOut(since time.Time, until time.Time) (float64, error)
- func (d Database) GetPensionSince(accountingDateStart time.Time, accountingDateEnd time.Time) (float64, error)
- func (d Database) GetRevenueSince(accountingDateStart time.Time, accountingDateEnd time.Time) (float64, error)
- func (d Database) GetTransactionsByCategories(categories ...TransactionCategory) ([]Transaction, error)
- func (d Database) GetTransactionsCount() (int, error)
- func (d Database) GetUnallocated() ([]Transaction, error)
- func (d Database) ImportTransactions(transactions []Transaction) (int, error)
- type Transaction
- type TransactionCategory
- type TransactionType
- type TransactionUi
Constants ¶
This section is empty.
Variables ¶
View Source
var TransactionCreditLabelMap = map[string]TransactionCategory{ "income": Income, "loan Return": LoansReturn, }
View Source
var TransactionDebitLabelMap = map[string]TransactionCategory{ "Unknown": Unknown, "Split between company and personal accounts": Personal, "Legal (accountancy, advertising)": Legal, "Travel expenses": Travel, "Office expenses": Office, "Equipment expenses": EquipmentExpenses, "Premises (heat, water, electricity)": Premises, "Cost of Sales (goods purchased for resale, subcontractors)": CostOfSales, "Wage payments, non-director salaries": WagesPayment, "Penalties and fines": Penalties, "Bank charges": BankCharges, "Pension": Pension, "HMRC (VAT payment, Corp Tax etc)": HMRC, "Fixed assets purchase": FixedAssetPurchase, "Loan": Loan, }
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (Database) AllocateTransactions ¶
func (d Database) AllocateTransactions(cats map[int]TransactionCategory) error
func (Database) GetExpensesSince ¶
func (Database) GetMovedOut ¶
func (Database) GetPensionSince ¶
func (Database) GetRevenueSince ¶
func (Database) GetTransactionsByCategories ¶
func (d Database) GetTransactionsByCategories(categories ...TransactionCategory) ([]Transaction, error)
func (Database) GetTransactionsCount ¶
func (Database) GetUnallocated ¶
func (d Database) GetUnallocated() ([]Transaction, error)
func (Database) ImportTransactions ¶
func (d Database) ImportTransactions(transactions []Transaction) (int, error)
type Transaction ¶
type Transaction struct { Pk int `storm:"id,increment"` // primary key with auto increment Date time.Time `storm:"index"` // midnight, GMT Type TransactionType `storm:"index"` Card string // last 4 digits Description string Credit float64 Debit float64 Balance float64 ToBeAllocated bool `storm:"index"` // when category of this transaction is specified, it is "allocated" Category TransactionCategory `storm:"index"` }
func (*Transaction) PrettyPrint ¶
func (s *Transaction) PrettyPrint() string
type TransactionCategory ¶
type TransactionCategory int
const ( Unknown TransactionCategory = 1 + iota Personal // split between company and personal accounts (salary and dividends) Legal // accountancy, advertising Travel Office // rent EquipmentExpenses // computers, hosting Premises // heat, water, electricity CostOfSales // goods purchased for resale, subcontractors WagesPayment // non-director sales Penalties BankCharges Pension HMRC FixedAssetPurchase Income LoansReturn Loan // when you borrow some money from your company and have to return it back )
type TransactionUi ¶
type TransactionUi struct {
// contains filtered or unexported fields
}
var CreditTransactionUI TransactionUi
var DebitTransactionUI TransactionUi
func (TransactionUi) GetLabels ¶
func (d TransactionUi) GetLabels() []string
func (TransactionUi) GetPositionFor ¶
func (d TransactionUi) GetPositionFor(category TransactionCategory) int
Click to show internal directories.
Click to hide internal directories.