invoicepdf

package
v0.0.0-...-9337404 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateInvoice

func GenerateInvoice(invoice *Invoice) (*bytes.Buffer, error)

Types

type Invoice

type Invoice struct {
	Id     string `json:"id" yaml:"id"`
	Number string `json:"number"`
	Title  string `json:"title" yaml:"title"`

	LogoUrl string         `json:"logo" yaml:"logo"`
	From    InvoiceCompany `json:"from" yaml:"from"`
	To      InvoiceCompany `json:"to" yaml:"to"`
	Date    string         `json:"date" yaml:"date"`
	Due     string         `json:"due" yaml:"due"`

	Items      []string  `json:"items" yaml:"items"`
	Quantities []int     `json:"quantities" yaml:"quantities"`
	Rates      []float64 `json:"rates" yaml:"rates"`
	AmountOnly bool      `json:"amount_only"`

	Tax      float64 `json:"tax" yaml:"tax"`
	Discount float64 `json:"discount" yaml:"discount"`
	Currency string  `json:"currency" yaml:"currency"`

	Note       string `json:"note" yaml:"note"`
	HeaderNote string `json:"header_note"`
}

func ExampleInvoice

func ExampleInvoice() *Invoice

type InvoiceCompany

type InvoiceCompany struct {
	Hide         bool   `json:"hide"`
	Name         string `json:"name"`
	AddressLine1 string `json:"address_line_1"`
	AddressLine2 string `json:"address_line_2"`
	City         string `json:"city"`
	Country      string `json:"country"`
	State        string `json:"state"`
	PostalCode   string `json:"postal_code"`
	TaxID        string `json:"tax_id"`
	Email        string `json:"email"`
	Website      string `json:"website"`
}

Jump to

Keyboard shortcuts

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