Documentation
¶
Overview ¶
nolint: gomnd
nolint: all
nolint: gomnd
nolint: gomnd
nolint: gomnd
nolint: gomnd
nolint: gomnd
nolint: gomnd
nolint: gomnd
Index ¶
- Variables
- type Bank
- type Buyer
- type Company
- type Invoice
- func (i *Invoice) BuildBankDetails()
- func (i *Invoice) BuildCompanyDetails()
- func (i *Invoice) BuildInvoiceHeader()
- func (i *Invoice) BuildInvoiceLineItems()
- func (i *Invoice) BuildPDFFooter()
- func (i *Invoice) BuildSignatureLines()
- func (i *Invoice) SaveAsBytes() ([]byte, error)
- func (i *Invoice) SaveToPdf(outputPath string) error
- type Item
- type Options
- type Seller
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCouldNotDoFontStuff is returned when we could not do font stuff ErrCouldNotDoFontStuff = errors.New("could not do font stuff") // ErrCouldNotSaveInvoice is returned when we could not save the invoice ErrCouldNotSaveInvoice = errors.New("could not save the invoice") // ErrCouldNotSetInvoiceLayout is returned when we could not set the invoice layout ErrCouldNotSetInvoiceLayout = errors.New("could not set the invoice layout") // ErrFailedParsingYAML is returned when the invoice input yaml could not be parsed ErrFailedParsingYAML = errors.New("could not unmarshal yaml values") )
Functions ¶
This section is empty.
Types ¶
type Buyer ¶
type Buyer struct {
Name string `yaml:"name"`
Address string `yaml:"address"`
VAT string `yaml:"vat"`
}
Buyer company details
type Invoice ¶
type Invoice struct {
Number string `yaml:"number"`
IssueDate string `yaml:"issueDate"`
SaleDate string `yaml:"saleDate"`
DueDate string `yaml:"dueDate"`
Notes string `yaml:"notes"`
Company Company `yaml:"company"`
Bank Bank `yaml:"bank"`
Items []*Item `yaml:"items"`
Currency string `yaml:"currency"`
Signature string `yaml:"signature"`
Options Options `yaml:"options"`
// contains filtered or unexported fields
}
Invoice parameters.
func NewInvoice ¶
New returns Invoice struct loaded with values from YAML and prepares PDF struct
func (*Invoice) BuildBankDetails ¶
func (i *Invoice) BuildBankDetails()
BuildBankDetails prepares rows with Bank details on the invoice
func (*Invoice) BuildCompanyDetails ¶
func (i *Invoice) BuildCompanyDetails()
BuildCompanyDetails prepares rows with Buyer and Seller contact details on the invoice
func (*Invoice) BuildInvoiceHeader ¶
func (i *Invoice) BuildInvoiceHeader()
BuildInvoiceHeader prepares header on the invoice
func (*Invoice) BuildInvoiceLineItems ¶
func (i *Invoice) BuildInvoiceLineItems()
BuildInvoiceLineItems prepares Tablelist with items on the invoice with calculated tax amounts and total gross amounts
func (*Invoice) BuildPDFFooter ¶
func (i *Invoice) BuildPDFFooter()
BuildPDFFooter prepares footer on the invoice
func (*Invoice) BuildSignatureLines ¶
func (i *Invoice) BuildSignatureLines()
BuildSignatureLines prepares signatures of the buyer and seller
func (*Invoice) SaveAsBytes ¶
Save saves Invoice to bytes and closes it
type Item ¶
type Item struct {
Description string `yaml:"description"`
Quantity float64 `yaml:"quantity"`
UnitPrice float64 `yaml:"unitPrice"`
VATRate float64 `yaml:"vatRate"`
}
Item parameters