webconform

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 = "conform.tex.tmpl"

Variables

This section is empty.

Functions

func Divide

func Divide(a float64, b int) float64

func DivideFloat

func DivideFloat(a, b float64) float64

func DivideTimesRate

func DivideTimesRate(a, b, rate float64) float64

func Euro

func Euro(a, rate float64) float64

func Half

func Half(a float64) float64

func Kenmerk added in v0.4.1

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 Conform

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

	Kenmerk string // Unique kenmerk of this invoice.

	Tour     string
	Persons  int
	Time     string
	Duration string // 2:00
	Cost     float64
	Rate     float64 // current GBP:EUR rate, autofill
	Date     string  // YYYY/MM/DD form
	Name     string
	FullName string
	Email    string // Has become optional.
	Where    string // Where to pickup.
	How      string // Ends in "om".

	Day string // autofill
}

Conform holds all the data we need to generate a conform

func (*Conform) Create

func (c *Conform) Create(tmplDir, tmpl string) ([]byte, error)

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

func (*Conform) ExecuteTemplateAndWrite

func (c *Conform) ExecuteTemplateAndWrite(t *template.Template, name, dst string) error

ExecuteTemplateAndWrite executes the template and writes the buffer to dst.

func (*Conform) FillOut

func (c *Conform) FillOut() (err error)

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

func (*Conform) MailBody

func (c *Conform) MailBody() (*bytes.Buffer, error)

func (*Conform) MailSubject

func (c *Conform) MailSubject() string

type ConformMail

type ConformMail struct {
	Name    string
	Kenmerk string
}

ConformMail is a customer conform form.

Jump to

Keyboard shortcuts

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