Documentation ¶
Index ¶
- Constants
- func BuKeyByVatRate(rate float64) int
- func IsValidVatID(vatID string) bool
- type Booking
- type BookingBuilder
- func (bb *BookingBuilder) Build() Booking
- func (bb *BookingBuilder) SetAccount(n int) *BookingBuilder
- func (bb *BookingBuilder) SetAdditionalInformation1(description, value string) *BookingBuilder
- func (bb *BookingBuilder) SetAmount(n float64) *BookingBuilder
- func (bb *BookingBuilder) SetBuKey(n int) *BookingBuilder
- func (bb *BookingBuilder) SetCAccount(n int) *BookingBuilder
- func (bb *BookingBuilder) SetCurrency(curr string, _course float64) *BookingBuilder
- func (bb *BookingBuilder) SetDate(t time.Time) *BookingBuilder
- func (bb *BookingBuilder) SetDestinationEuInformation(countryCode string, rate float64) *BookingBuilder
- func (bb *BookingBuilder) SetDocField(s string) *BookingBuilder
- func (bb *BookingBuilder) SetDocumentLink(uuid uuid.UUID) *BookingBuilder
- func (bb *BookingBuilder) SetKOST(n int) *BookingBuilder
- func (bb *BookingBuilder) SetMinValues(date time.Time, amount float64, cAccount int, account int, docField string, ...) *BookingBuilder
- func (bb *BookingBuilder) SetOriginEuInformation(countryCode string, rate float64) *BookingBuilder
- func (bb *BookingBuilder) SetPerformanceDate(t time.Time) *BookingBuilder
- func (bb *BookingBuilder) SetText(s string) *BookingBuilder
- func (bb *BookingBuilder) SetVatID(s string) *BookingBuilder
- type BookingLogger
- type Countries
- type Exporter
- type ExporterConfig
- type Period
- type XMLFactory
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func BuKeyByVatRate ¶
func IsValidVatID ¶
IsValidVatID check if given string is a valid VatID. see https://de.wikipedia.org/wiki/Umsatzsteuer-Identifikationsnummer
Types ¶
type BookingBuilder ¶
type BookingBuilder struct {
// contains filtered or unexported fields
}
BookingBuilder implements a builder pattern to create booking that are equivalent to the format specification from the DATEV-Format
func NewBookingBuilder ¶
func NewBookingBuilder() *BookingBuilder
func (*BookingBuilder) Build ¶
func (bb *BookingBuilder) Build() Booking
Build returns the prepared Booking Before returning, the function checks if any errors occurred while preparing the booking
func (*BookingBuilder) SetAccount ¶
func (bb *BookingBuilder) SetAccount(n int) *BookingBuilder
SetAccount set the value for the datev column 'Konto'
func (*BookingBuilder) SetAdditionalInformation1 ¶
func (bb *BookingBuilder) SetAdditionalInformation1(description, value string) *BookingBuilder
SetAdditionalInformation1 sets the key and value for datev column 'Zusatzinformation'
func (*BookingBuilder) SetAmount ¶
func (bb *BookingBuilder) SetAmount(n float64) *BookingBuilder
SetAmount sets the values for the datev columns 'Umsatz (ohne Soll/Haben-Kz)' and 'Soll/Haben-Kennzeichen'. The 'Soll/Haben-Kennzeichen' is implicit set. 'S' if the amount is positive and 'H' if it's not
func (*BookingBuilder) SetBuKey ¶
func (bb *BookingBuilder) SetBuKey(n int) *BookingBuilder
SetBuKey set the value for the datev column 'BU-Schlüssel'
func (*BookingBuilder) SetCAccount ¶
func (bb *BookingBuilder) SetCAccount(n int) *BookingBuilder
SetCAccount set the value for the datev column 'Gegenkonto'
func (*BookingBuilder) SetCurrency ¶
func (bb *BookingBuilder) SetCurrency(curr string, _course float64) *BookingBuilder
SetCurrency sets the values for the datev columns 'WKZ-Umsatz' and 'Kurs'
func (*BookingBuilder) SetDate ¶
func (bb *BookingBuilder) SetDate(t time.Time) *BookingBuilder
SetDate set the value for the datev column 'Belegdatum'
func (*BookingBuilder) SetDestinationEuInformation ¶
func (bb *BookingBuilder) SetDestinationEuInformation(countryCode string, rate float64) *BookingBuilder
SetDestinationEuInformation sets the values for the datev columns 'EU-Land u. UStID (Bestimmung)' and 'EU-Steuersatz (Bestimmung)' Before saving, the function sanitize the vat rate to integer level, because the DATEV-Formats expect this
func (*BookingBuilder) SetDocField ¶
func (bb *BookingBuilder) SetDocField(s string) *BookingBuilder
SetDocField set the value for the datev column 'Belegfeld 1'
func (*BookingBuilder) SetDocumentLink ¶
func (bb *BookingBuilder) SetDocumentLink(uuid uuid.UUID) *BookingBuilder
SetDocumentLink set a document link to link a booking to a document in DUO (or something else) the UUID is also used to create the document.xml file for the DATEV XML interface
func (*BookingBuilder) SetKOST ¶
func (bb *BookingBuilder) SetKOST(n int) *BookingBuilder
SetKOST set the value for the datev column 'KOST1'
func (*BookingBuilder) SetMinValues ¶
func (bb *BookingBuilder) SetMinValues(date time.Time, amount float64, cAccount int, account int, docField string, text string) *BookingBuilder
SetMinValues is a helper function to set minimal attributes to Booking
func (*BookingBuilder) SetOriginEuInformation ¶
func (bb *BookingBuilder) SetOriginEuInformation(countryCode string, rate float64) *BookingBuilder
SetOriginEuInformation sets the values for the datev columns 'EU-Land u. UStID (Ursprung)' and 'EU-Steuersatz (Ursprung)' Before saving, the function sanitize the vat rate to integer level, because the DATEV-Formats expect this
func (*BookingBuilder) SetPerformanceDate ¶
func (bb *BookingBuilder) SetPerformanceDate(t time.Time) *BookingBuilder
func (*BookingBuilder) SetText ¶
func (bb *BookingBuilder) SetText(s string) *BookingBuilder
SetText set the value for the datev column 'Buchungstext'
func (*BookingBuilder) SetVatID ¶
func (bb *BookingBuilder) SetVatID(s string) *BookingBuilder
SetVatID set the value for the datev column 'EU-Land u. UStID (Bestimmung)'
type BookingLogger ¶
type BookingLogger struct {
// contains filtered or unexported fields
}
func NewBookingLogger ¶
func NewBookingLogger() *BookingLogger
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
func NewExporter ¶
func NewExporter(filePath string, cfg ExporterConfig) *Exporter
func (*Exporter) CreateExport ¶
CreateExport creates an export file in DATEV-Format
func (*Exporter) SetDeviatingFinanceYear ¶
type ExporterConfig ¶
type XMLFactory ¶
type XMLFactory struct {
// contains filtered or unexported fields
}
func NewXMLFactory ¶
func NewXMLFactory() XMLFactory
func (XMLFactory) AddDocument ¶
func (f XMLFactory) AddDocument(uid uuid.UUID, filePath string)
AddDocument add an uuid.UUID with a filePath to the entry. All entries will be written into document.xml
func (XMLFactory) Execute ¶
func (f XMLFactory) Execute(saveDir string) error
Execute create a .zip archive and copy all documents, that are related to a booking into this archive Also it creates the document.xml file to bind the UUIDs with the files Implements the DATEV XML-online interface (https://developer.datev.de/datev/platform/de/dxso)