invoice

package
v0.0.0-...-6ea566c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BankDetails

type BankDetails struct {
	TransferType  string `yaml:"transfer_type"`
	Name          string
	Address       string
	AccountType   string `yaml:"account_type"`
	AccountNumber string `yaml:"account_number"`
	RoutingNumber string `yaml:"routing_number"`
	IBAN          string
	SortCode      string `yaml:"sort_code"`
	SWIFTBIC      string `yaml:"swift_bic"`
}

func (*BankDetails) Strings

func (b *BankDetails) Strings() []string

type Bill

type Bill struct {
	// contains filtered or unexported fields
}

func NewBill

func NewBill(config *BillingConfig) *Bill

NewBill begins generating an A4-sized Bill

func (*Bill) RenderToFile

func (b *Bill) RenderToFile() error

type BillColor

type BillColor struct {
	ColorLight Color `yaml:"color_light"`
	ColorDark  Color `yaml:"color_dark"`
}

type BillDetails

type BillDetails struct {
	Department   string `yaml:"department"`
	Currency     string `yaml:"currency"`
	PaymentTerms string `yaml:"payment_terms"`
	DueDate      string `yaml:"due_date"`
	Date         string `yaml:"date"`
}

func (*BillDetails) Strings

func (b *BillDetails) Strings() []string

type BillToDetails

type BillToDetails struct {
	Email        string
	Name         string
	Street       string
	CityStateZip string `yaml:"city_state_zip"`
	Country      string
}

type BillableItem

type BillableItem struct {
	Quantity    float64
	Description string
	UnitPrice   float64 `yaml:"unit_price"`
	Currency    string
}

func (*BillableItem) Strings

func (b *BillableItem) Strings() []string

func (*BillableItem) Total

func (b *BillableItem) Total() float64

type BillingConfig

type BillingConfig struct {
	Business  *BusinessDetails `yaml:"business"`
	Bill      *BillDetails     `yaml:"bill"`
	BillTo    *BillToDetails   `yaml:"bill_to"`
	Billables []BillableItem   `yaml:"billables"`
	Bank      *BankDetails     `yaml:"bank"`
	Colors    *BillColor       `yaml:"colors"`
}

func ParseConfig

func ParseConfig(filename string, billingDate string) (*BillingConfig, error)

ParseConfig parses the YAML config file which contains the settings for the bill we're going to process. It uses a simple FuncMap to template the text, allowing the billing items to describe the current date range.

type BusinessDetails

type BusinessDetails struct {
	Name      string `yaml:"name"`
	Person    string `yaml:"person"`
	Address   string `yaml:"address"`
	ImageFile string `yaml:"image_file"`
	SansFont  string `yaml:"sans_font"`
	SerifFont string `yaml:"serif_font"`
}

type Color

type Color struct {
	R int
	G int
	B int
}

Jump to

Keyboard shortcuts

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