posting

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupByMonth added in v0.2.1

func GroupByMonth(postings []Posting) map[string][]Posting

func UpsertAll

func UpsertAll(db *gorm.DB, postings []*Posting)

Types

type Posting

type Posting struct {
	ID        uint      `gorm:"primaryKey" json:"id"`
	Date      time.Time `json:"date"`
	Payee     string    `json:"payee"`
	Account   string    `json:"account"`
	Commodity string    `json:"commodity"`
	Quantity  float64   `json:"quantity"`
	Amount    float64   `json:"amount"`

	MarketAmount float64 `gorm:"-:all" json:"market_amount"`
}

func (*Posting) AddQuantity added in v0.2.2

func (p *Posting) AddQuantity(quantity float64)

func (*Posting) Price added in v0.2.2

func (p *Posting) Price() float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL