records

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const NA = "n.a."

Variables

This section is empty.

Functions

func GenerateExpenseRec

func GenerateExpenseRec(s schema.Schema, exp schema.Expense, dstPath string, downConvert bool, wg *sync.WaitGroup)

GenerateExpenseRec generates and saves the record PDF for a given expense.

func GenerateExpensesRec

func GenerateExpensesRec(s schema.Schema, dstFolder string, doOverwrite, downConvert bool)

GenerateExpensesRec generates an record document for all expenses in the given schema. The PDFs will then be saved into the given destination folder. DownConvert (converting all PDF's to a PostScript file and back) should be done always as gopdf will have otherwise problems embedding most PDFs.

func GenerateInvoiceRec

func GenerateInvoiceRec(s schema.Schema, inv schema.Invoice, dstPath string, downConvert bool, wg *sync.WaitGroup)

GenerateInvoiceRec generates and saves the record PDF for a given invoice.

func GenerateInvoicesRec

func GenerateInvoicesRec(s schema.Schema, dstPath string, doOverwrite, downConvert bool)

GenerateInvoicesRec generates an record document for all invoices in the given schema. The PDFs will then be saved into the given destination folder. DownConvert (converting all PDF's to a PostScript file and back) should be done always as gopdf will have otherwise problems embedding most PDFs.

func GenerateMiscRec

func GenerateMiscRec(s schema.Schema, mrc schema.MiscRecord, dstPath string, downConvert bool, wg *sync.WaitGroup)

GenerateMiscRec generates and saves the record PDF for a given misc-record.

func GenerateMiscsRec

func GenerateMiscsRec(s schema.Schema, dstPath string, doOverwrite, downConvert bool)

GenerateMiscsRec generates an record document for all misc-records in the given schema. The PDFs will then be saved into the given destination folder. DownConvert (converting all PDF's to a PostScript file and back) should be done always as gopdf will have otherwise problems embedding most PDFs.

Types

type Pdf

type Pdf struct {
	SrcPath string
	ScrType ScrType
	DstPath string
	// contains filtered or unexported fields
}

Pdf is the PDF document structure for report PDFs.

func NewPdf

func NewPdf(srcPath, dstPath string) *Pdf

NewPdf returns a new PDF.

func (*Pdf) Generate

func (p *Pdf) Generate(props Properties, downConvert bool)

Generate generates and saves the file for a given Pdf element.

type PdfVersion

type PdfVersion int

PdfVersion states the used PDF version.

type Properties

type Properties struct {
	Type       string
	Identifier string
	DstName    string
	Line1      string
	Line2      string
	Line3      string
	Line4      string
	Line5      string
}

Properties are the data needed to create a record document.

type ScrType

type ScrType int

ScrType states whether a given asset is a PDF or a PNG.

const (
	PDF ScrType = iota
	PNG
)

Jump to

Keyboard shortcuts

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