Versions in this module Expand all Collapse all v4 v4.0.0 Jul 6, 2022 Changes in this version + const BaseMargin + const BaseMarginTop + const DeliveryNote + const DiscountTypeAmount + const DiscountTypePercent + const HeaderMarginTop + const Invoice + const ItemColDiscountOffset + const ItemColNameOffset + const ItemColQuantityOffset + const ItemColTaxOffset + const ItemColTotalHTOffset + const ItemColTotalTTCOffset + const ItemColUnitPriceOffset + const MaxPageHeight + const Quotation + const TaxTypeAmount + const TaxTypePercent + var BaseTextFontSize float64 = 8 + var ErrInvalidDiscount = errors.New("invalid discount") + var ErrInvalidTax = errors.New("invalid tax") + var ExtraSmallTextFontSize float64 = 6 + var LargeTextFontSize float64 = 10 + var SmallTextFontSize float64 = 7 + type Address struct + Address string + Address2 string + City string + Country string + PostalCode string + func (a *Address) ToString() string + type Contact struct + Address *Address + Logo *[]byte + Name string + type Discount struct + Amount string + Percent string + func (d *Discount) Prepare() error + type Document struct + ClientRef string + Company *Contact + Customer *Contact + Date string + DefaultTax *Tax + Description string + Discount *Discount + Footer *HeaderFooter + Header *HeaderFooter + Items []*Item + Notes string + Options *Options + PaymentTerm string + Ref string + Type string + ValidityDate string + Version string + func New(docType string, options *Options) (*Document, error) + func (d *Document) AppendItem(item *Item) *Document + func (d *Document) SetCompany(company *Contact) *Document + func (d *Document) SetCustomer(customer *Contact) *Document + func (d *Document) SetDate(date string) *Document + func (d *Document) SetDefaultTax(tax *Tax) *Document + func (d *Document) SetDescription(desc string) *Document + func (d *Document) SetDiscount(discount *Discount) *Document + func (d *Document) SetFooter(footer *HeaderFooter) *Document + func (d *Document) SetHeader(header *HeaderFooter) *Document + func (d *Document) SetNotes(notes string) *Document + func (d *Document) SetPaymentTerm(term string) *Document + func (d *Document) SetRef(ref string) *Document + func (d *Document) SetType(docType string) *Document + func (d *Document) SetVersion(version string) *Document + func (d *Document) Validate() error + func (doc *Document) Build() (*fpdf.Fpdf, error) + func (doc *Document) Pdf() *fpdf.Fpdf + func (doc *Document) SetUnicodeTranslator(fn UnicodeTranslateFunc) + func (doc *Document) Tax() decimal.Decimal + func (doc *Document) TotalWithTax() decimal.Decimal + func (doc *Document) TotalWithoutTax() decimal.Decimal + func (doc *Document) TotalWithoutTaxAndWithoutDocumentDiscount() decimal.Decimal + type HeaderFooter struct + FontSize float64 + Pagination bool + Text string + UseCustomFunc bool + func (hf *HeaderFooter) ApplyFunc(pdf *fpdf.Fpdf, fn fnc) + type Item struct + Description string + Discount *Discount + Name string + Quantity string + Tax *Tax + UnitCost string + func (i *Item) Prepare() error + func (i *Item) TaxWithTotalDiscounted() decimal.Decimal + func (i *Item) TotalWithTaxAndDiscount() decimal.Decimal + func (i *Item) TotalWithoutTaxAndWithDiscount() decimal.Decimal + func (i *Item) TotalWithoutTaxAndWithoutDiscount() decimal.Decimal + type Options struct + AutoPrint bool + BaseTextColor []int + BoldFont string + CurrencyDecimal string + CurrencyPrecision int + CurrencySymbol string + CurrencyThousand string + DarkBgColor []int + Font string + GreyBgColor []int + GreyTextColor []int + TextDateTitle string + TextItemsDiscountTitle string + TextItemsNameTitle string + TextItemsQuantityTitle string + TextItemsTaxTitle string + TextItemsTotalHTTitle string + TextItemsTotalTTCTitle string + TextItemsUnitCostTitle string + TextPaymentTermTitle string + TextRefTitle string + TextTotalDiscounted string + TextTotalTax string + TextTotalTotal string + TextTotalWithTax string + TextTypeDeliveryNote string + TextTypeInvoice string + TextTypeQuotation string + TextVersionTitle string + UnicodeTranslateFunc UnicodeTranslateFunc + type Tax struct + Amount string + Percent string + func (t *Tax) Prepare() error + type UnicodeTranslateFunc func(string) string Other modules containing this package github.com/CodyStringham/go-invoice-generator github.com/CodyStringham/go-invoice-generator/v3 github.com/CodyStringham/go-invoice-generator/v5 github.com/CodyStringham/go-invoice-generator/v6