Documentation ¶
Index ¶
- Constants
- Variables
- func ConsumptionListFormatValues(consumptions []Consumption, child Child, products map[string]Product, ...) (string, float64)
- type Address
- type Adult
- func (a Adult) Address() Address
- func (a Adult) BirthDate() time.Time
- func (a Adult) Email() string
- func (a Adult) GrandMotherPhone() string
- func (a Adult) GrandParentPhone() string
- func (a Adult) HomePhone() string
- func (a Adult) MobilePhone() string
- func (a Adult) MobilePhoneFmt() string
- func (a Adult) Name() string
- func (a Adult) NameAndSurname() string
- func (a Adult) Nationality() Nationality
- func (a Adult) Role() adult_role.AdultRole
- func (a Adult) SecondSurname() string
- func (a Adult) Surname() string
- func (a Adult) TaxID() TaxId
- func (a Adult) WorkPhone() string
- type Child
- func (c Child) Active() bool
- func (c Child) BirthDate() time.Time
- func (c Child) CustomerId() int
- func (c Child) Group() group_type.GroupType
- func (c Child) Id() int
- func (c Child) Name() string
- func (c Child) NameAndSurname() string
- func (c Child) NameWithId() string
- func (c Child) Note() string
- func (c Child) SecondSurname() string
- func (c Child) String() string
- func (c Child) Surname() string
- func (c Child) TaxID() TaxId
- type Consumption
- func (c Consumption) ChildId() int
- func (c Consumption) Id() string
- func (c Consumption) InvoiceId() string
- func (c Consumption) IsRectification() bool
- func (c Consumption) Note() string
- func (c Consumption) ProductId() string
- func (c Consumption) String() string
- func (c Consumption) Units() float64
- func (c Consumption) YearMonth() YearMonth
- type Customer
- func (c Customer) Active() bool
- func (c Customer) Adults() []Adult
- func (c Customer) ChangedOn() time.Time
- func (c Customer) Children() []Child
- func (c Customer) ChildrenNames(joinWith string) string
- func (c Customer) ChildrenNamesWithId(joinWith string) string
- func (c Customer) ChildrenNamesWithSurname(joinWith string) string
- func (c Customer) FirstAdult() Adult
- func (c Customer) FirstAdultName() string
- func (c Customer) FirstAdultNameWithId() string
- func (c Customer) Id() int
- func (c Customer) InvoiceHolder() InvoiceHolder
- func (c Customer) Language() language.Language
- func (c Customer) Note() string
- func (c Customer) String() string
- type IBAN
- type Invoice
- func (i Invoice) Amount() float64
- func (i Invoice) ChildrenIds() []int
- func (i Invoice) CustomerId() int
- func (i Invoice) Date() time.Time
- func (i Invoice) DateFmt() string
- func (i Invoice) Emailed() bool
- func (i Invoice) Id() string
- func (i Invoice) Lines() []InvoiceLine
- func (i Invoice) LinesFmt(joinWith string) string
- func (i Invoice) Note() string
- func (i Invoice) PaymentType() payment_type.PaymentType
- func (i Invoice) Printed() bool
- func (i Invoice) SendToBank() Invoice
- func (i Invoice) SentToBank() bool
- func (i Invoice) String() string
- func (i Invoice) YearMonth() YearMonth
- type InvoiceHolder
- func (i InvoiceHolder) Address() Address
- func (i InvoiceHolder) Email() string
- func (i InvoiceHolder) Iban() IBAN
- func (i InvoiceHolder) IsBusiness() bool
- func (i InvoiceHolder) Mail() string
- func (i InvoiceHolder) Name() string
- func (i InvoiceHolder) PaymentInfoFmt() string
- func (i InvoiceHolder) PaymentType() payment_type.PaymentType
- func (i InvoiceHolder) SendEmail() bool
- func (i InvoiceHolder) TaxID() TaxId
- func (i InvoiceHolder) Validate() error
- type InvoiceLine
- type Nationality
- type Product
- type Sequence
- type TaxId
- type TransientChild
- type TransientConsumption
- type TransientCustomer
- type TransientInvoice
- type YearMonth
Constants ¶
View Source
const ConsumptionIdLength = 8
View Source
const YearMonthLayout = "2006-01"
Variables ¶
View Source
var InvoiceF100 = NewInvoice( "F-100", 148, TestDate, NewYearMonth(2019, 5), []int{1800, 1801}, lines, payment_type.BankDirectDebit, "Invoice note", false, false, false, )
View Source
var InvoiceF101 = NewInvoice( "F-101", 148, TestDate, NewYearMonth(2019, 5), []int{1801, 1802}, lines, payment_type.BankDirectDebit, "Invoice note", false, false, false, )
View Source
var InvoiceF102 = NewInvoice( "F-102", 149, TestDate, NewYearMonth(2019, 5), []int{1800, 1801, 1802}, lines, payment_type.BankDirectDebit, "Invoice note", false, false, false, )
View Source
var InvoiceF103 = NewInvoice( "F-103", 149, TestDate, NewYearMonth(2019, 5), []int{1800}, lines, payment_type.BankDirectDebit, "Invoice note", false, false, false, )
View Source
var ProductTST, _ = NewProduct(
"TST",
"Test product",
"TstProduct",
10.9,
0.0,
false,
)
View Source
var ProductXXX, _ = NewProduct(
"XXX",
"XXX product",
"XxxProduct",
9.1,
0.0,
false,
)
View Source
var ProductYYY, _ = NewProduct(
"YYY",
"YYY product",
"YyyProduct",
5,
0.1,
false,
)
View Source
var TestAdultFather148 = NewAdult( "Bob", "Novella", "Sagan", NewTaxIdOrEmpty("71032204Q"), adult_role.Father, NewAddress( "Carrer Ucraïna 2022, 1st", "07007", "Palma", "Illes Balears", ), "bob@sgu.org", "654321097", "987654322", "685698788", "658785477", "987525446", TestDate, NewNationalityOrEmpty("UK"), )
View Source
var TestAdultFather149 = NewAdult( "Joan", "Petit", "Galatzó", NewTaxIdOrEmpty("91071996T"), adult_role.Father, NewAddress( "Carrer de sa Tanca 2, 1er", "07192", "Estellencs", "Illes Balears", ), "joan@cameva.org", "654321099", "987654329", "685698789", "658785479", "987525449", TestDate, NewNationalityOrEmpty("ES"), )
View Source
var TestAdultMother148 = NewAdult( "Cara", "Santamaria", "Novella", NewTaxIdOrEmpty("36361882D"), adult_role.Mother, NewAddress( "Carrer Ucraïna 2022, 1st", "07007", "Palma", "Illes Balears", ), "cara@sgu.org", "654321098", "987654321", "685698789", "658785478", "987525444", TestDate, NewNationalityOrEmpty("US"), )
View Source
var TestAdultMother149 = NewAdult( "Joana", "Petita", "Puig", NewTaxIdOrEmpty("80587890F"), adult_role.Mother, NewAddress( "Carrer de sa Tanca 2, 1er", "07192", "Estellencs", "Illes Balears", ), "joana@cameva.org", "654521098", "987674321", "695698789", "657785478", "987524444", TestDate, NewNationalityOrEmpty("ES"), )
View Source
var TestChild1480 = NewChild( 1480, "Laura", "Llull", "Bibiloni", NewTaxIdOrEmpty(""), TestDate, group_type.Ei1, "Note child 1480", true, )
View Source
var TestChild1481 = NewChild( 1481, "Aina", "Llull", "Bibiloni", NewTaxIdOrEmpty("60235657Z"), TestDate, group_type.Ei1, "Note child 1481", true, )
View Source
var TestChild1490 = NewChild( 1490, "Antònia", "Petit", "Petita", NewTaxIdOrEmpty("81620787C"), TestDate, group_type.Ei2, "Note child 1490", true, )
View Source
var TestChild1491 = NewChild( 1491, "Antoni", "Petit", "Petita", NewTaxIdOrEmpty("51389353Q"), TestDate, group_type.Ei3, "Note child 1491", true, )
View Source
var TestCustomer148 = NewCustomer( 148, true, []Child{ TestChild1480, TestChild1481, }, []Adult{ TestAdultMother148, TestAdultFather148, }, TestInvoiceHolder148, "Nota del client 148", language.Catalan, TestDate, )
View Source
var TestCustomer149 = NewCustomer( 149, true, []Child{ TestChild1490, TestChild1491, }, []Adult{ TestAdultMother149, TestAdultFather149, }, TestInvoiceHolder149, "Nota del client 149", language.Catalan, TestDate, )
View Source
var TestDate = time.Date(2019, 5, 25, 0, 0, 0, 0, time.UTC)
View Source
var TestInvoiceHolder148 = NewInvoiceHolder( "Cara Santamaria Novella", NewTaxIdOrEmpty("36361882D"), NewAddress( "Carrer Ucraïna 2022, 1st", "07007", "Palma", "Illes Balears", ), "cara@sgu.org", false, payment_type.BankDirectDebit, NewIbanOrEmpty("ES2830668859978258529057"), false, )
View Source
var TestInvoiceHolder149 = NewInvoiceHolder( "Nom empresa", NewTaxIdOrEmpty("37866397W"), NewAddress( "Address first line", "07007", "Palma", "Illes Balears", ), "email@gmail.com", false, payment_type.BankTransfer, NewIbanOrEmpty("ES2830668859978258529057"), true, )
Functions ¶
func ConsumptionListFormatValues ¶ added in v1.0.1
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func NewAddress ¶ added in v0.23.0
func (Address) CompleteAddress ¶ added in v0.18.0
type Adult ¶
type Adult struct {
// contains filtered or unexported fields
}
func (Adult) GrandMotherPhone ¶
func (Adult) GrandParentPhone ¶
func (Adult) MobilePhone ¶
func (Adult) MobilePhoneFmt ¶
func (Adult) NameAndSurname ¶ added in v0.18.0
func (Adult) Nationality ¶
func (a Adult) Nationality() Nationality
func (Adult) Role ¶
func (a Adult) Role() adult_role.AdultRole
func (Adult) SecondSurname ¶
type Child ¶
type Child struct {
// contains filtered or unexported fields
}
func (Child) CustomerId ¶ added in v1.0.1
func (Child) Group ¶
func (c Child) Group() group_type.GroupType
func (Child) NameAndSurname ¶
func (Child) NameWithId ¶
func (Child) SecondSurname ¶
type Consumption ¶
type Consumption struct {
// contains filtered or unexported fields
}
func NewConsumption ¶ added in v0.23.0
func (Consumption) ChildId ¶
func (c Consumption) ChildId() int
func (Consumption) Id ¶
func (c Consumption) Id() string
func (Consumption) InvoiceId ¶
func (c Consumption) InvoiceId() string
func (Consumption) IsRectification ¶
func (c Consumption) IsRectification() bool
func (Consumption) Note ¶
func (c Consumption) Note() string
func (Consumption) ProductId ¶
func (c Consumption) ProductId() string
func (Consumption) String ¶
func (c Consumption) String() string
func (Consumption) Units ¶
func (c Consumption) Units() float64
func (Consumption) YearMonth ¶
func (c Consumption) YearMonth() YearMonth
type Customer ¶
type Customer struct {
// contains filtered or unexported fields
}
func NewCustomer ¶ added in v0.23.0
func (Customer) ChildrenNames ¶
func (Customer) ChildrenNamesWithId ¶ added in v0.18.0
func (Customer) ChildrenNamesWithSurname ¶ added in v0.18.0
func (Customer) FirstAdult ¶
func (Customer) FirstAdultName ¶
func (Customer) FirstAdultNameWithId ¶
func (Customer) InvoiceHolder ¶
func (c Customer) InvoiceHolder() InvoiceHolder
type IBAN ¶ added in v0.23.0
type IBAN struct {
// contains filtered or unexported fields
}
func NewIbanOrEmpty ¶ added in v0.23.0
type Invoice ¶
type Invoice struct {
// contains filtered or unexported fields
}
func NewInvoice ¶ added in v0.23.0
func NewInvoice( id string, customerId int, date time.Time, yearMonth YearMonth, childrenIds []int, lines []InvoiceLine, paymentType payment_type.PaymentType, note string, emailed bool, printed bool, sentToBank bool, ) Invoice
func (Invoice) ChildrenIds ¶
func (Invoice) CustomerId ¶
func (Invoice) Lines ¶
func (i Invoice) Lines() []InvoiceLine
func (Invoice) PaymentType ¶
func (i Invoice) PaymentType() payment_type.PaymentType
func (Invoice) SendToBank ¶ added in v1.0.1
SendToBank sets sentToBank to true
func (Invoice) SentToBank ¶
type InvoiceHolder ¶
type InvoiceHolder struct {
// contains filtered or unexported fields
}
func NewInvoiceHolder ¶ added in v0.23.0
func NewInvoiceHolder( name string, taxID TaxId, address Address, email string, sendEmail bool, paymentType payment_type.PaymentType, iban IBAN, isBusiness bool, ) InvoiceHolder
func (InvoiceHolder) Address ¶
func (i InvoiceHolder) Address() Address
func (InvoiceHolder) Email ¶
func (i InvoiceHolder) Email() string
func (InvoiceHolder) Iban ¶ added in v0.23.0
func (i InvoiceHolder) Iban() IBAN
func (InvoiceHolder) IsBusiness ¶
func (i InvoiceHolder) IsBusiness() bool
func (InvoiceHolder) Mail ¶
func (i InvoiceHolder) Mail() string
func (InvoiceHolder) Name ¶
func (i InvoiceHolder) Name() string
func (InvoiceHolder) PaymentInfoFmt ¶
func (i InvoiceHolder) PaymentInfoFmt() string
func (InvoiceHolder) PaymentType ¶
func (i InvoiceHolder) PaymentType() payment_type.PaymentType
func (InvoiceHolder) SendEmail ¶
func (i InvoiceHolder) SendEmail() bool
func (InvoiceHolder) TaxID ¶
func (i InvoiceHolder) TaxID() TaxId
func (InvoiceHolder) Validate ¶ added in v0.23.0
func (i InvoiceHolder) Validate() error
type InvoiceLine ¶ added in v0.23.0
type InvoiceLine struct {
// contains filtered or unexported fields
}
func NewInvoiceLine ¶ added in v0.23.0
func (InvoiceLine) ChildId ¶ added in v0.23.0
func (i InvoiceLine) ChildId() int
func (InvoiceLine) Format ¶ added in v0.23.0
func (i InvoiceLine) Format() string
func (InvoiceLine) ProductId ¶ added in v0.23.0
func (i InvoiceLine) ProductId() string
func (InvoiceLine) ProductPrice ¶ added in v0.23.0
func (i InvoiceLine) ProductPrice() float64
func (InvoiceLine) TaxPercentage ¶ added in v0.23.0
func (i InvoiceLine) TaxPercentage() float64
func (InvoiceLine) Units ¶ added in v0.23.0
func (i InvoiceLine) Units() float64
type Nationality ¶ added in v0.23.0
type Nationality struct {
// contains filtered or unexported fields
}
func NewNationality ¶ added in v0.23.0
func NewNationality(alpha2Code string) (Nationality, error)
func NewNationalityOrEmpty ¶ added in v0.23.0
func NewNationalityOrEmpty(alpha2Code string) Nationality
func (Nationality) String ¶ added in v0.23.0
func (n Nationality) String() string
type Product ¶
type Product struct {
// contains filtered or unexported fields
}
func NewProduct ¶ added in v0.23.0
func (Product) TaxPercentage ¶
type Sequence ¶
type Sequence struct {
// contains filtered or unexported fields
}
func NewSequence ¶ added in v0.23.0
func NewSequence(id sequence_type.SequenceType, counter int) Sequence
func (Sequence) Id ¶
func (s Sequence) Id() sequence_type.SequenceType
type TaxId ¶ added in v0.23.0
type TaxId struct {
// contains filtered or unexported fields
}
func NewTaxIdOrEmpty ¶ added in v0.23.0
type TransientChild ¶ added in v0.23.0
type TransientChild struct { Name string Surname string SecondSurname string TaxID TaxId BirthDate time.Time Group group_type.GroupType Note string }
func (TransientChild) Validate ¶ added in v0.23.0
func (t TransientChild) Validate() error
type TransientConsumption ¶ added in v0.23.0
type TransientCustomer ¶ added in v0.23.0
type TransientCustomer struct { Children []TransientChild Adults []Adult InvoiceHolder InvoiceHolder Note string Language language.Language }
func (TransientCustomer) Validate ¶ added in v0.23.0
func (t TransientCustomer) Validate() error
type TransientInvoice ¶ added in v0.23.0
type TransientInvoice struct { IsRectification bool CustomerId int Date time.Time YearMonth YearMonth ChildrenIds []int Lines []InvoiceLine PaymentType payment_type.PaymentType Note string }
type YearMonth ¶ added in v0.20.0
type YearMonth struct {
// contains filtered or unexported fields
}
func StringToYearMonth ¶ added in v0.20.0
func TimeToYearMonth ¶ added in v0.20.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.