Documentation
¶
Index ¶
Constants ¶
View Source
const ( // AlignDefault does not express any text alignment. AlignDefault alignment = "" // AlignLeft expresses that text should be aligned left. AlignLeft alignment = "L" // AlignCenter expresses that text should be aligned center. AlignCenter alignment = "C" // AlignRight expresses that text should be aligned right. AlignRight alignment = "R" )
View Source
const ( // BorderNone indicates that no border should be added. BorderNone border = "" // BorderFull indicates that a border should be added to every side. BorderFull border = "1" // BorderBottom indicates that a border should be added only to the bottem. BorderBottom border = "B" )
Variables ¶
View Source
var LabelsEnglish = Labels{
BankAccount: "Bank account",
HeaderText: "INVOICE",
Identification: "Invoice number",
InvoiceDate: "Invoice date",
PaymentSpan: "Please pay within",
PaymentSpanUnit: "days",
Period: "Period",
PeriodFromTo: "-",
Taxnumber: "VAT registration",
Total: "Total",
TotalTax: "VAT",
TotalWithoutTax: "Total without VAT",
}
LabelsEnglish represents the labels in English.
View Source
var LabelsNederlands = Labels{
BankAccount: "Bankrekening",
HeaderText: "FACTUUR",
Identification: "Factuurnummer",
InvoiceDate: "Factuurdatum",
PaymentSpan: "Gelieve te betalen binnen",
PaymentSpanUnit: "dagen",
Period: "Periode",
PeriodFromTo: "t/m",
Taxnumber: "BTW-nummer",
Total: "Totaal",
TotalTax: "BTW",
TotalWithoutTax: "Totaal excl. BTW",
}
LabelsNederlands represents the labels in Dutch.
View Source
var StyleDefault = Style{ DateFormat: "yyyy-MM-dd", Font: &Font{"Arial", "", 11, &Color{0, 0, 0}}, ItemBorders: BorderNone, ItemFont: &Font{"Arial", "", 11, &Color{0, 0, 0}}, ItemSubFont: &Font{"Arial", "I", 8, &Color{100, 100, 100}}, }
StyleDefault represents a default visual style.
Functions ¶
This section is empty.
Types ¶
type Invoice ¶
type Invoice struct {
Sender Organisation
Recipient Organisation
Labels Labels
Style Style
Logo string
PaymentSpan int
BankAccount string
Taxnumber string
Identification string
InvoiceDate time.Time
FromDate time.Time
ToDate time.Time
TotalWithoutTax string
TotalTax string
Total string
// contains filtered or unexported fields
}
Invoice represents an invoice.
func (*Invoice) AddItemHeader ¶
func (i *Invoice) AddItemHeader(widthPercentage int, text string, textAlignment alignment, borderSetting border)
AddItemHeader adds an items header to this invoice.
func (*Invoice) WriteToFile ¶
WriteToFile generates the pdf invoice document and writes it to outFile.
type Item ¶
type Item []string
Item represents an invoice line for a sold product or service.
func (Item) GetAsAssetFileBase ¶
GetAsAssetFileBase returns the asset filename for the element of this item as the provided index.
func (Item) GetAsAssetName ¶
GetAsAssetName returns the asset full file path for the element of this item as the provided index.
type Labels ¶
type Labels struct {
BankAccount string
HeaderText string
Identification string
InvoiceDate string
PaymentSpan string
PaymentSpanUnit string
Period string
PeriodFromTo string
Taxnumber string
Total string
TotalTax string
TotalWithoutTax string
}
Labels represents the collection of simple text labels in a certain language used in the invoice.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.