webtocht

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Template = "magic.tex.tmpl"

Variables

This section is empty.

Functions

func Euro

func Euro(a, rate float64) float64

func Kenmerk

func Kenmerk(now time.Time) string

Kernmerk returns a unique identifier for this confirmation.

func TeXFiles

func TeXFiles(dir string) ([]string, error)

TeXFiles returns the tex and jpg files found in the directory dir.

Types

type Tocht

type Tocht struct {
	FileName string // Name of the generated PDF.

	Kenmerk string // Unique kenmerk of this invoice.

	Tour     string
	Cost     float64
	Rate     float64 // current GBP:EUR rate, autofill
	Date     string  // YYYY/MM/DD form
	Name     string
	FullName string
	Email    string
}

Tocht holds all the data we need to generate a tocht.

func (*Tocht) Create

func (t *Tocht) Create(tmplDir, tmpl string) ([]byte, error)

Create parses the templates and runs pdflatex on the resulting tex file. It returns generated PDF.

func (*Tocht) ExecuteTemplateAndWrite

func (t *Tocht) ExecuteTemplateAndWrite(te *template.Template, name, dst string) error

ExecuteTemplateAndWrite executes the template and writes the buffer to dst.

func (*Tocht) FillOut

func (t *Tocht) FillOut() (err error)

FillOut fills in these missing fields in i, such as: Day, Filename and makes Date Dutch.

func (*Tocht) MailBody

func (t *Tocht) MailBody() (*bytes.Buffer, error)

func (*Tocht) MailSubject

func (t *Tocht) MailSubject() string

type TochtMail

type TochtMail struct {
	Name    string
	Kenmerk string
}

TochtMail is a customer tocht form.

Jump to

Keyboard shortcuts

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