datev

package module
v0.0.0-...-94622f9 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuKeyNotTaxable          int = 191
	BuKeyReverseCharge       int = 270
	BuKeyOSS                 int = 280
	BuKeyUSt7                int = 102
	BuKeyUSt19               int = 101
	BuKeyDeactivateAutomatic int = 40
)

Variables

This section is empty.

Functions

func BuKeyByVatRate

func BuKeyByVatRate(rate float64) int

func IsValidVatID

func IsValidVatID(vatID string) bool

IsValidVatID check if given string is a valid VatID. see https://de.wikipedia.org/wiki/Umsatzsteuer-Identifikationsnummer

Types

type Booking

type Booking struct {
	Period Period
	// contains filtered or unexported fields
}

func (*Booking) IsEmpty

func (b *Booking) IsEmpty() bool

func (*Booking) IsEqual

func (b *Booking) IsEqual(other Booking) bool

func (*Booking) String

func (b *Booking) String() string

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 (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 Countries

type Countries map[string]country

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

func NewExporter

func NewExporter(filePath string, cfg ExporterConfig) *Exporter

func (*Exporter) AddXmlDocument

func (e *Exporter) AddXmlDocument(uid uuid.UUID, filePath string)

func (*Exporter) CreateExport

func (e *Exporter) CreateExport(bookings []Booking, fileName string) error

CreateExport creates an export file in DATEV-Format

func (*Exporter) SetDeviatingFinanceYear

func (e *Exporter) SetDeviatingFinanceYear(year, month int)

type ExporterConfig

type ExporterConfig struct {
	ConsultantNumber int
	ClientNumber     int
	SKL              int
	SKR              int
	Fixation         bool
	MainPeriod       Period
}

type Period

type Period struct {
	Month int
	Year  int
}

func (Period) Begin

func (p Period) Begin() time.Time

func (Period) End

func (p Period) End() time.Time

func (Period) String

func (p Period) String() string

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)

Jump to

Keyboard shortcuts

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