model

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ConsumptionIdLength = 8

Variables

This section is empty.

Functions

func ConsumptionListToString

func ConsumptionListToString(consumptions []Consumption, child Child, products []Product) string

Types

type Address

type Address struct {
	Street  string
	ZipCode string
	City    string
	State   string
}

type Adult

type Adult struct {
	Name             string
	Surname          string
	SecondSurname    string
	TaxID            string
	Role             string
	Address          Address
	Email            string
	MobilePhone      string
	HomePhone        string
	GrandMotherPhone string
	GrandParentPhone string
	WorkPhone        string
	BirthDate        time.Time
	Nationality      string
}

func (Adult) MobilePhoneFmt

func (a Adult) MobilePhoneFmt() string

func (Adult) NameSurnameFmt

func (a Adult) NameSurnameFmt() string

type Child

type Child struct {
	Id            int
	Name          string
	Surname       string
	SecondSurname string
	TaxID         string
	BirthDate     time.Time
	Group         string
	Note          string
	Active        bool
}

func (Child) NameAndSurname

func (c Child) NameAndSurname() string

func (Child) NameWithId

func (c Child) NameWithId() string

func (Child) String

func (c Child) String() string

type Consumption

type Consumption struct {
	Id              string
	ChildId         int
	ProductId       string
	Units           float64
	YearMonth       string
	Note            string
	IsRectification bool
	InvoiceId       string
}

func (Consumption) String

func (c Consumption) String() string

type Customer

type Customer struct {
	Id            int
	Active        bool
	Children      []Child
	Adults        []Adult
	InvoiceHolder InvoiceHolder
	Note          interface{}
	Language      string
}

func (Customer) ChildrenNames

func (c Customer) ChildrenNames(joinWith string) string

func (Customer) FirstAdult

func (c Customer) FirstAdult() Adult

func (Customer) FirstAdultName

func (c Customer) FirstAdultName() string

func (Customer) FirstAdultNameWithId

func (c Customer) FirstAdultNameWithId() string

func (Customer) String

func (c Customer) String() string

type Invoice

type Invoice struct {
	Id          string
	CustomerId  int
	Date        time.Time
	YearMonth   string
	ChildrenIds []int
	Lines       []Line
	PaymentType payment_type.PaymentType
	Note        string
	Emailed     bool
	Printed     bool
	SentToBank  bool
}

func (Invoice) Amount

func (i Invoice) Amount() float64

func (Invoice) DateFmt

func (i Invoice) DateFmt() string

func (Invoice) LinesFmt

func (i Invoice) LinesFmt(joinWith string) string

func (Invoice) String

func (i Invoice) String() string

type InvoiceHolder

type InvoiceHolder struct {
	Name        string
	TaxID       string
	Address     Address
	Email       string
	SendEmail   bool
	PaymentType payment_type.PaymentType
	BankAccount string
	IsBusiness  bool
}

func (InvoiceHolder) BankAccountFmt

func (i InvoiceHolder) BankAccountFmt() string

func (InvoiceHolder) Mail

func (i InvoiceHolder) Mail() string

func (InvoiceHolder) PaymentInfoFmt

func (i InvoiceHolder) PaymentInfoFmt() string

type Line

type Line struct {
	ProductId     string
	Units         float64
	ProductPrice  float64
	TaxPercentage float64
	ChildId       int
}

type Product

type Product struct {
	Id            string
	Name          string
	ShortName     string
	Price         float64
	TaxPercentage float64
	IsSubsidy     bool
}

func GetProduct

func GetProduct(productID string, products []Product) Product

func (Product) String

func (p Product) String() string

type Sequence

type Sequence struct {
	Id      sequence_type.SequenceType
	Counter int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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