mydataInvoices

package
v0.0.0-...-4ed90be Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Address

type Address struct {
	Street     string `xml:"street"`
	Number     string `xml:"number"`
	PostalCode string `xml:"postalCode"`
	City       string `xml:"city"`
}

type BookInfo

type BookInfo struct {
	ContinuationToken struct {
		NextPartitionKey string `xml:"nextPartitionKey"`
		NextRowKey       string `xml:"nextRowKey"`
	} `xml:"continuationToken"` // Στοιχείο για την τμηματική λήψη	αποτελεσμάτων
	IssueDate         string                         `xml:"issueDate"`         // Ημερομηνία έκδοσης
	InvType           mydatavalues.InvoiceType       `xml:"invType"`           // Τύπος Παραστατικού
	SelfPricing       bool                           `xml:"selfPricing"`       // Αυτοτιμολόγηση
	InvoiceDetailType mydatavalues.InvoiceDetailType `xml:"invoiceDetailType"` // Επισήμανση
	NetValue          float64                        `xml:"netValue"`          // Καθαρή αξία
	VatAmount         float64                        `xml:"vatAmount"`         // Ποσό ΦΠΑ
	WithheldAmount    float64                        `xml:"withheldAmount"`    // Ποσό Παρακράτησης Φόρου
	OtherTaxesAmount  float64                        `xml:"otherTaxesAmount"`  // Ποσό Λοιπών Φόρων
	StampDutyAmount   float64                        `xml:"stampDutyAmount"`   // Ποσό Χαρτοσήμου
	FeesAmount        float64                        `xml:"feesAmount"`        // Ποσό Τελών
	DeductionsAmount  float64                        `xml:"deductionsAmount"`  // Ποσό Κρατήσεων
	ThirdPartyAmount  float64                        `xml:"thirdPartyAmount"`  // Ποσό Περί Τρίτων
	GrossValue        float64                        `xml:"grossValue"`        // Συνολική Αξία
	Count             int                            `xml:"count"`             // * Πλήθος Παραστατικών
	MinMark           string                         `xml:"minMark"`           // Ελάχιστο ΜΑΡΚ πλήθους
	MaxMark           string                         `xml:"maxMark"`           // Μέγιστο ΜΑΡΚ πλήθους
}

type CancelInvoiceParams

type CancelInvoiceParams struct {
	Mark            string // * Μοναδικός αριθμός καταχώρησης
	EntityVatNumber string // ΑΦΜ αναφοράς
}

func (*CancelInvoiceParams) ToMap

func (p *CancelInvoiceParams) ToMap() (map[string]string, error)

type CancelledInvoice

type CancelledInvoice struct {
	InvoiceMark      *uint64 `xml:"invoiceMark"`
	CancellationMark *uint64 `xml:"cancellationMark"`
	CancellationDate string  `xml:"cancellationDate"`
}

type CancelledInvoicesDoc

type CancelledInvoicesDoc struct {
	CancelledInvoices []*CancelledInvoice `xml:"cancelledInvoice"`
}

type ContinuationToken

type ContinuationToken struct {
	NextPartitionKey string `xml:"nextPartitionKey"`
	NextRowKey       string `xml:"nextRowKey"`
}

type ECRTokenType

type ECRTokenType struct {
	SigningAuthor *string `xml:"SigningAuthor"` // ECR id: Αριθμός μητρώου του φορολογικού μηχανισμού
	Signature     *string `xml:"Signature"`     // Υπογραφή παρόχου (μέγιστο 20 χαρακτήρες).Λεπτομέρειες στην υπ’ αριθμ.Α.1155/09-10-2023 απόφαση ΦΕΚ 5992 Β΄/13.10.2023
}

type EntityType

type EntityType struct {
	Type *mydatavalues.EntityCategory `xml:"type"` // Κατηγορία Οντότητας
	// contains filtered or unexported fields
}

type Error

type Error struct {
	Message string `xml:"message"`
	Code    string `xml:"code"`
}

func (Error) Error

func (e Error) Error() string

Error implements the error interface and returns a human-readable representation of the given error.

type Errors

type Errors struct {
	Error []Error `xml:"error"`
}

type ExpensesClassificationType

type ExpensesClassificationType struct {
	ClassificationType     *mydatavalues.ExpenseClassificationTypeStringType      `xml:"classificationType"`     // Κωδικός Χαρακτηρισμού
	ClassificationCategory *mydatavalues.ExpensesClassificationCategoryStringType `xml:"classificationCategory"` // Κατηγορία Χαρακτηρισμού
	Amount                 float64                                                `xml:"amount"`                 // * Ποσό
	VatAmount              *float64                                               `xml:"vatAmount"`              // Ποσό ΦΠΑ
	VatCategory            *mydatavalues.InvoiceVATCategory                       `xml:"vatCategory"`            // Κατηγορία ΦΠΑ
	VatExemptionCategory   *mydatavalues.VATExceptionReasonType                   `xml:"vatExemptionCategory"`   // Κατηγορία Αιτίας Απαλλαγής ΦΠΑ
	ID                     *byte                                                  `xml:"id"`                     // Αύξων αριθμός χαρακτηρισμού
}

func NewExpenseClassification

NewExpenseClassification returns a new ExpensesClassificationType for E3 classifications

func (*ExpensesClassificationType) MarshalXML

func (cl *ExpensesClassificationType) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the invoice's ExpensesClassificationType to xml

func (*ExpensesClassificationType) SetVatAmount

func (cl *ExpensesClassificationType) SetVatAmount(vatAmount float64) *ExpensesClassificationType

func (*ExpensesClassificationType) SetVatCategory

func (*ExpensesClassificationType) SetVatExemptionCategory

func (cl *ExpensesClassificationType) SetVatExemptionCategory(vatExemptionCategory mydatavalues.VATExceptionReasonType) *ExpensesClassificationType

type ExpensesClassificationsDoc

type ExpensesClassificationsDoc struct {
	Xmlns     string `xml:"xmlns,attr"`
	XmlnsEcls string `xml:"xmlns:ecls,attr"`
	//XmlnsXsi                      string                           `xml:"xmlns:xsi,attr"`
	//SchemaLocation string `xml:"xsi:schemaLocation,attr"`
	ExpensesInvoiceClassification []*ExpensesInvoiceClassification `xml:"expensesInvoiceClassification"` // Χαρακτηρισμοί Εξόδων Πρότυπων Παραστατικών ΑΑΔΕ
}

func NewExpensesClassificationDoc

func NewExpensesClassificationDoc() *ExpensesClassificationsDoc

func (*ExpensesClassificationsDoc) DeviateClassification

func (d *ExpensesClassificationsDoc) DeviateClassification(mark uint64, entityVatNumber string)

func (*ExpensesClassificationsDoc) EditLineNumberDetail

func (d *ExpensesClassificationsDoc) EditLineNumberDetail(
	mark uint64, entityVatNumber string, lineNumber int,
	clType mydatavalues.ExpenseClassificationTypeStringType,
	clCategory mydatavalues.ExpensesClassificationCategoryStringType,
	amount float64)

EditLineNumberDetail adds an expense classification to an invoice with a given mark for a specific line number. This is the old way of adding classifications to an invoice. It is kept for backwards compatibility. It should be used with postPerInvoice to false

func (*ExpensesClassificationsDoc) NewInvoiceClassificationForMark

func (d *ExpensesClassificationsDoc) NewInvoiceClassificationForMark(mark uint64, entityVatNumber string) *ExpensesInvoiceClassification

NewInvoiceClassificationForMark adds an expense classification to an invoice with a given mark. We should append at this slice, classifications for E3 and VAT. At least one for each.

func (*ExpensesClassificationsDoc) RejectClassification

func (d *ExpensesClassificationsDoc) RejectClassification(mark uint64, entityVatNumber string)

func (*ExpensesClassificationsDoc) ValidateAgainstInvoice

func (d *ExpensesClassificationsDoc) ValidateAgainstInvoice(v *Invoice) error

ValidateAgainstInvoice validates the classification doc against an invoice. requirements can be viewed in https://www.aade.gr/sites/default/files/2023-07/SendExpensesClassificationPostPerInvoiceGuidelines.pdf

type ExpensesInvoiceClassification

type ExpensesInvoiceClassification struct {
	InvoiceMark                           uint64                                   `xml:"invoiceMark"`                           // Μοναδικός Αριθμός Καταχώρησης Παραστατικού
	ClassificationMark                    *uint64                                  `xml:"classificationMark"`                    // Αποδεικτικό Λήψης Χαρακτηρισμού Εσόδων. Συμπληρώνεται από την Υπηρεσία
	EntityVatNumber                       *string                                  `xml:"entityVatNumber"`                       // ΑΦΜ Οντότητας Αναφοράς (μόνο όταν κληθεί από λογιστή ή εκπρόσωπο)
	TransactionMode                       *int                                     `xml:"transactionMode"`                       // Αιτιολογία Συναλλαγής. 1:Reject 2: Deviation.
	InvoicesExpensesClassificationDetails []*InvoicesExpensesClassificationDetails `xml:"invoicesExpensesClassificationDetails"` // Στοιχεία Χαρακτηρισμού Εξόδων
	ClassificationPostMode                *byte                                    `xml:"classificationPostMode"`                // Μέθοδος Υποβολής Χαρακτηρισμού (1: Σημαίνει οτι ο χαρακτηρισμός αφορά ολόκληρο το παραστατικό 0: Ο χαρακτηρισμός αφορά μια γραμμή μόνο)
}

func (*ExpensesInvoiceClassification) AddE3ClassificationDetail

AddE3ClassificationDetail adds an E3 expense classification to an invoice with a given mark. returns a pointer to the ExpensesInvoiceClassification for chaining. this way we can add multiple e3 and vat classifications.

func (*ExpensesInvoiceClassification) CalculateClassificationTotals

func (d *ExpensesInvoiceClassification) CalculateClassificationTotals() (float64, float64)

type IncomeClassificationType

type IncomeClassificationType struct {
	ClassificationType     *mydatavalues.IncomeClassificationTypeStringType     `xml:"classificationType"`     // Κωδικός Χαρακτηρισμού
	ClassificationCategory *mydatavalues.IncomeClassificationCategoryStringType `xml:"classificationCategory"` // Κατηγορία Χαρακτηρισμού
	Amount                 float64                                              `xml:"amount"`                 // * Ποσό
	ID                     *byte                                                `xml:"id"`                     // Αύξων αριθμός χαρακτηρισμού
}

func (IncomeClassificationType) MarshalXML

func (cl IncomeClassificationType) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the invoice's IncomeClassificationType to xml

type IncomeClassificationsDoc

type IncomeClassificationsDoc struct {
	Xmlns                       string                         `xml:"xmlns,attr"`
	SchemaLocation              string                         `xml:"xsi:schemaLocation,attr"`
	XmlnsXsi                    string                         `xml:"xmlns:xsi,attr"`
	XmlnsIcls                   string                         `xml:"xmlns:icls,attr"`
	IncomeInvoiceClassification []*IncomeInvoiceClassification `xml:"incomeInvoiceClassification"` // Χαρακτηρισμοί Εσόδων Πρότυπων Παραστατικών ΑΑΔΕ
}

func NewIncomeClassificationDoc

func NewIncomeClassificationDoc() *IncomeClassificationsDoc

func (*IncomeClassificationsDoc) DeviateClassification

func (d *IncomeClassificationsDoc) DeviateClassification(mark uint64, entityVatNumber string)

func (*IncomeClassificationsDoc) EditLineNumberDetail

func (d *IncomeClassificationsDoc) EditLineNumberDetail(
	mark uint64, entityVatNumber string, lineNumber int,
	clType mydatavalues.IncomeClassificationTypeStringType,
	clCategory mydatavalues.IncomeClassificationCategoryStringType,
	amount float64, id byte)

EditLineNumberDetail adds an income classification to an invoice with a given mark for a specific line number.

func (*IncomeClassificationsDoc) RejectClassification

func (d *IncomeClassificationsDoc) RejectClassification(mark uint64, entityVatNumber string)

type IncomeInvoiceClassification

type IncomeInvoiceClassification struct {
	InvoiceMark                         uint64                                 `xml:"invoiceMark"`                         // Μοναδικός Αριθμός Καταχώρησης Παραστατικού
	ClassificationMark                  *uint64                                `xml:"classificationMark"`                  // Αποδεικτικό Λήψης Χαρακτηρισμού Εσόδων. Συμπληρώνεται από την Υπηρεσία
	EntityVatNumber                     *string                                `xml:"entityVatNumber"`                     // ΑΦΜ Οντότητας Αναφοράς (μόνο όταν κληθεί από λογιστή ή εκπρόσωπο)
	TransactionMode                     *int                                   `xml:"transactionMode"`                     // Αιτιολογία Συναλλαγής. 1:Reject 2: Deviation.
	InvoicesIncomeClassificationDetails []*InvoicesIncomeClassificationDetails `xml:"invoicesIncomeClassificationDetails"` // Στοιχεία Χαρακτηρισμού Εσόδων
}

type Invoice

type Invoice struct {
	UID                   *string                               `xml:"uid"`                   // Αναγνωριστικό Παραστατικού (από υπηρεσία)
	Mark                  *uint64                               `xml:"mark"`                  // Μοναδικός Αριθμός Καταχώρησης Παραστατικού (από υπηρεσία)
	CancelledByMark       *uint64                               `xml:"cancelledByMark"`       // Μοναδικός Αριθμός Καταχώρησης Ακυρωτικού (από υπηρεσία)
	AuthenticationCode    *string                               `xml:"authenticationCode"`    // Συμβολοσειρά Αυθεντικοποίησης (από υπηρεσία)
	TransmissionFailure   *mydatavalues.TransmissionFailureType `xml:"transmissionFailure"`   // Αδυναμία επικοινωνίας παρόχου ή διαβίβασης δεδομένων
	Issuer                *PartyType                            `xml:"issuer"`                // Στοιχεία Εκδότη Παραστατικού
	Counterpart           *PartyType                            `xml:"counterpart"`           // Στοιχεία Λήπτη Παραστατικού
	InvoiceHeader         *InvoiceHeaderType                    `xml:"invoiceHeader"`         // * Επικεφαλίδα Παραστατικού
	PaymentMethods        *PaymentMethods                       `xml:"paymentMethods"`        // Στοιχεία Πληρωμής
	InvoiceDetails        []*InvoiceRowType                     `xml:"invoiceDetails"`        // * Γραμμές Παραστατικού
	TaxesTotals           *TaxTotalsType                        `xml:"taxesTotals"`           // Σύνολα Φόρων
	InvoiceSummary        *InvoiceSummaryType                   `xml:"invoiceSummary"`        // * Περίληψη Παραστατικού
	QrCodeUrl             *string                               `xml:"qrCodeUrl"`             // Κωδικοποιημένο αλφαριθμητικό για να χρησιμοποιηθεί από τα προγράμματα για τη δημιουργία QR Code τύπου Url (από υπηρεσία)
	OtherTransportDetails *TransportDetailType                  `xml:"otherTransportDetails"` // Λοιπές λεπτομέρειες διακίνησης
}

func NewInvoice

func NewInvoice(series string, aa string, issueDate time.Time, invType mydatavalues.InvoiceType) *Invoice

func (*Invoice) AddInvoiceRow

func (i *Invoice) AddInvoiceRow(row *InvoiceRowType) *Invoice

AddInvoiceRow adds an invoice row to the invoice's rows array

func (*Invoice) AddPaymentMethod

func (i *Invoice) AddPaymentMethod(method mydatavalues.InvoicePaymentType, amount float64, paymentInfo string) *Invoice

AddPaymentMethod sets the invoice's payment method

func (*Invoice) AddPaymentMethodPOS

func (i *Invoice) AddPaymentMethodPOS(amount float64, paymentInfo string, transactionId string, signingAuthor string, sessionNumber string) *Invoice

func (*Invoice) AddTaxTotals

func (i *Invoice) AddTaxTotals(taxType mydatavalues.TaxType, taxCategory uint, underlyingValue float64, amount float64, id byte) *Invoice

AddTaxTotals adds a tax total to the invoice's tax totals array

func (*Invoice) CalculateSummary

func (i *Invoice) CalculateSummary()

CalculateSummary calculates the summary values from the rows and TaxTotals

func (*Invoice) SetCounterPart

func (i *Invoice) SetCounterPart(vat string, country string, branch uint64) *Invoice

SetCounterPart sets the invoice's counterpart

func (*Invoice) SetIssuer

func (i *Invoice) SetIssuer(vat string, country string, branch uint64) *Invoice

SetIssuer sets the invoice's issuer

func (*Invoice) Validate

func (i *Invoice) Validate() error

Validate validates the invoice

func (*Invoice) ValidateRow

func (i *Invoice) ValidateRow() error

type InvoiceHeaderType

type InvoiceHeaderType struct {
	Series                  string                                 `xml:"series"`                  // * Σειρά παραστατικού (max 50 chars)
	Aa                      string                                 `xml:"aa"`                      // * ΑΑ παραστατικού (max 50 chars)
	IssueDate               string                                 `xml:"issueDate"`               // * Ημερομηνία έκδοσης
	InvoiceType             *mydatavalues.InvoiceType              `xml:"invoiceType"`             // * Είδος παραστατικού
	VatPaymentSuspension    *bool                                  `xml:"vatPaymentSuspension"`    // Αναστολή καταβολής ΦΠΑ
	Currency                *string                                `xml:"currency"`                // Νόμισμα
	ExchangeRate            *float64                               `xml:"exchangeRate"`            // Ισοτιμία
	SelfPricing             *bool                                  `xml:"selfPricing"`             // Αυτοτιμολόγηση
	CorrelatedInvoices      []*uint                                `xml:"correlatedInvoices"`      // Συσχετιζόμενα παραστατικά
	DispatchDate            *string                                `xml:"dispatchDate"`            // Ημερομηνία αποστολής
	DispatchTime            *string                                `xml:"dispatchTime"`            // Ώρα αποστολής
	VehicleNumber           *string                                `xml:"vehicleNumber"`           // Αριθμός οχήματος
	MovePurpose             *mydatavalues.InvoicePurposeOfMovement `xml:"movePurpose"`             // Σκοπός διακίνησης 1-8
	FuelInvoice             *bool                                  `xml:"fuelInvoice"`             // Παραστατικό καυσίμων
	SpecialInvoiceCategory  *mydatavalues.InvoiceSpecialCategory   `xml:"specialInvoiceCategory"`  // Ειδική κατηγορία παραστατικού 1-4
	InvoiceVariationType    *mydatavalues.InvoiceVariationType     `xml:"invoiceVariationType"`    // Τύπος απόκλισης παραστατικού 1-4
	OtherCorrelatedEntities *EntityType                            `xml:"otherCorrelatedEntities"` // Λοιπές συσχετιζόμενες οντότητες
	OtherDeliveryNoteHeader *OtherDeliveryNoteHeaderType           `xml:"otherDeliveryNoteHeader"` // Λοιπές συσχετιζόμενες οντότητες
	IsDeliveryNote          *bool                                  `xml:"isDeliveryNote"`          // Παραστατικό παράδοσης?
	OtherMovePurposeTitle   *string                                `xml:"otherMovePurposeTitle"`   // Άλλος σκοπός διακίνησης Αποδεκτό μόνο για την περίπτωση που movePurpose = 19
	ThirdPartyCollection    *bool                                  `xml:"thirdPartyCollection"`    // Συλλογή από τρίτο πρόσωπο Αποδεκτό μόνο για παραστατικά τύπου 8.4 και 8.5
}

func NewInvoiceHeader

func NewInvoiceHeader(series string, aa string, issueDate time.Time, invType mydatavalues.InvoiceType) *InvoiceHeaderType

func (*InvoiceHeaderType) SetCurrency

func (i *InvoiceHeaderType) SetCurrency(currency string) *InvoiceHeaderType

SetCurrency sets the invoice header's currency.

func (*InvoiceHeaderType) SetDispatchDate

func (i *InvoiceHeaderType) SetDispatchDate(date time.Time) *InvoiceHeaderType

SetDispatchDate sets the invoice header's dispatch date.

func (*InvoiceHeaderType) SetDispatchTime

func (i *InvoiceHeaderType) SetDispatchTime(time time.Time) *InvoiceHeaderType

SetDispatchTime sets the invoice header's dispatch time.

func (*InvoiceHeaderType) SetExchangeRate

func (i *InvoiceHeaderType) SetExchangeRate(rate float64) *InvoiceHeaderType

SetExchangeRate sets the invoice header's exchange rate.

func (*InvoiceHeaderType) SetFuelInvoice

func (i *InvoiceHeaderType) SetFuelInvoice(value bool) *InvoiceHeaderType

SetFuelInvoice sets the invoice header's fuel invoice.

func (*InvoiceHeaderType) SetInvoiceSpecialCategory

func (i *InvoiceHeaderType) SetInvoiceSpecialCategory(value mydatavalues.InvoiceSpecialCategory) *InvoiceHeaderType

SetInvoiceSpecialCategory sets the invoice header's special category.

func (*InvoiceHeaderType) SetInvoiceVariationType

func (i *InvoiceHeaderType) SetInvoiceVariationType(value mydatavalues.InvoiceVariationType) *InvoiceHeaderType

SetInvoiceVariationType sets the invoice header's variation type.

func (*InvoiceHeaderType) SetMovePurpose

SetMovePurpose sets the invoice header's move purpose.

func (*InvoiceHeaderType) SetOtherCorrelatedEntity

func (i *InvoiceHeaderType) SetOtherCorrelatedEntity(category mydatavalues.EntityCategory, vat string, country string, branch uint64) *InvoiceHeaderType

SetOtherCorrelatedEntity sets the invoice header's other correlated entities.

func (*InvoiceHeaderType) SetSelfPricing

func (i *InvoiceHeaderType) SetSelfPricing(value bool) *InvoiceHeaderType

SetSelfPricing sets the invoice header's self-pricing.

func (*InvoiceHeaderType) SetVatPaymentSuspension

func (i *InvoiceHeaderType) SetVatPaymentSuspension(value bool) *InvoiceHeaderType

SetVatPaymentSuspension sets the invoice header's vat payment suspension.

func (*InvoiceHeaderType) SetVehicleNumber

func (i *InvoiceHeaderType) SetVehicleNumber(vehicle string) *InvoiceHeaderType

SetVehicleNumber sets the invoice header's vehicle number.

type InvoiceRowType

type InvoiceRowType struct {
	LineNumber                   *uint                                    `xml:"lineNumber"`                   // * ΑΑ γραμμής
	RecType                      *mydatavalues.InvoiceLineType            `xml:"recType"`                      // Είδος Γραμμής
	FuelCode                     *mydatavalues.FuelCode                   `xml:"fuelCode"`                     // Κωδικός Καυσίμου
	Quantity                     *float64                                 `xml:"quantity"`                     // Ποσότητα
	MeasurementUnit              *mydatavalues.InvoiceMeasurementUnit     `xml:"measurementUnit"`              // Είδος Ποσότητας
	InvoiceDetailType            *mydatavalues.InvoiceDetailType          `xml:"invoiceDetailType"`            // Επισήμανση
	NetValue                     *float64                                 `xml:"netValue"`                     // * Καθαρή αξία
	VatCategory                  *mydatavalues.InvoiceVATCategory         `xml:"vatCategory"`                  // * Κατηγορία ΦΠΑ
	VatAmount                    *float64                                 `xml:"vatAmount"`                    // * Ποσό ΦΠΑ
	VatExemptionCategory         *mydatavalues.VATExceptionReasonType     `xml:"vatExemptionCategory"`         // Κατηγορία Αιτίας Απαλλαγής ΦΠΑ
	Dienergia                    *ShipType                                `xml:"dienergia"`                    // ΠΟΛ 1177/2018	Αρ. 27
	DiscountOption               *bool                                    `xml:"discountOption"`               // Δικαίωμα έκπτωσης
	WithheldAmount               *float64                                 `xml:"withheldAmount"`               // Ποσό παρακράτησης φόρου
	WithheldPercentCategory      *mydatavalues.WithholdingTaxCategoryType `xml:"withheldPercentCategory"`      // Κατηγορία ποσοστού παρακράτησης φόρου
	StampDutyAmount              *float64                                 `xml:"stampDutyAmount"`              // Ποσό Χαρτοσήμου
	StampDutyPercentCategory     *mydatavalues.PaperStampCategoryType     `xml:"stampDutyPercentCategory"`     // Κατηγορία ποσοστού χαρτοσήμου
	FeesAmount                   *float64                                 `xml:"feesAmount"`                   // Ποσό Τελών
	FeesPercentCategory          *mydatavalues.FeeCategoriesType          `xml:"feesPercentCategory"`          // Κατηγορία ποσοστού τελών
	OtherTaxesPercentCategory    *mydatavalues.MiscTaxCategoryType        `xml:"otherTaxesPercentCategory"`    // Κατηγορία ποσοστού λοιπών φόρων
	OtherTaxesAmount             *float64                                 `xml:"otherTaxesAmount"`             // Ποσό Λοιπών Φόρων
	DeductionsAmount             *float64                                 `xml:"deductionsAmount"`             // Ποσό Κρατήσεων
	LineComments                 *string                                  `xml:"lineComments"`                 // Σχόλια γραμμής
	IncomeClassification         []*IncomeClassificationType              `xml:"incomeClassification"`         // Χαρακτηρισμοί Εσόδων
	ExpensesClassification       []*ExpensesClassificationType            `xml:"expensesClassification"`       // Χαρακτηρισμοί Εξόδων
	Quantity15                   *float64                                 `xml:"quantity15"`                   // Ποσότητα Θερμοκρασίας 15 βαθμών (για παραστατικά καυσίμων από παρόχους)
	ItemDescr                    *string                                  `xml:"itemDescr"`                    // Περιγραφή Είδους (max 300 chars).Μόνο για την ειδική κατηγορία tax free
	TaricNo                      *string                                  `xml:"TaricNo"`                      // Κωδικός ΤΑΡΙΚ.
	ItemCode                     *string                                  `xml:"itemCode"`                     // Κωδικός Είδους.
	OtherMeasurementUnitQuantity *int                                     `xml:"otherMeasurementUnitQuantity"` // Ποσότητα Εναλλακτικής Μονάδας Μέτρησης.Μόνο όταν measurementUnit = 7
	OtherMeasurementUnitTitle    *string                                  `xml:"otherMeasurementUnitTitle"`    // Τίτλος Εναλλακτικής Μονάδας Μέτρησης.Μόνο όταν measurementUnit = 7
}

func NewInvoiceRow

func NewInvoiceRow(netValue float64, vatCat mydatavalues.InvoiceVATCategory) *InvoiceRowType

func (*InvoiceRowType) AddE3ExpenseClassification

AddE3ExpenseClassification adds an expense classification to the invoice row's expense classification array. This does not classify VAT values

func (*InvoiceRowType) AddIncomeClassification

AddIncomeClassification adds an income classification to the invoice row's income classification array.

func (*InvoiceRowType) AddVATExpenseClassification

AddVATExpenseClassification adds an expense classification to the invoice row's expense classification array. This does not classify VAT values

func (*InvoiceRowType) IsVATExempt

func (i *InvoiceRowType) IsVATExempt() bool

func (*InvoiceRowType) SetComment

func (i *InvoiceRowType) SetComment(comment string) *InvoiceRowType

SetComment sets the invoice row's comment.

func (*InvoiceRowType) SetDeductionsAmount

func (i *InvoiceRowType) SetDeductionsAmount(amount float64) *InvoiceRowType

SetDeductionsAmount sets the invoice row's.

func (*InvoiceRowType) SetDienergia

func (i *InvoiceRowType) SetDienergia(appID string, appDate time.Time, doy string, shipID string) *InvoiceRowType

SetDienergia sets the invoice row's dienergia.

func (*InvoiceRowType) SetDiscountOption

func (i *InvoiceRowType) SetDiscountOption(discount bool) *InvoiceRowType

SetDiscountOption sets the invoice row's discount option.

func (*InvoiceRowType) SetFeesAmount

func (i *InvoiceRowType) SetFeesAmount(amount float64, category mydatavalues.FeeCategoriesType) *InvoiceRowType

SetFeesAmount sets the invoice row's fee amount and category.

func (*InvoiceRowType) SetFuelCode

func (i *InvoiceRowType) SetFuelCode(code mydatavalues.FuelCode) *InvoiceRowType

SetFuelCode sets the invoice row's fuel code

func (*InvoiceRowType) SetInvoiceDetailType

func (i *InvoiceRowType) SetInvoiceDetailType(detailType mydatavalues.InvoiceDetailType) *InvoiceRowType

SetInvoiceDetailType sets the invoice row's detail type.

func (*InvoiceRowType) SetItemDescription

func (i *InvoiceRowType) SetItemDescription(description string) *InvoiceRowType

SetItemDescription sets the invoice row's item description.

func (*InvoiceRowType) SetMeasurementUnit

SetMeasurementUnit sets the invoice row's measurement unit.

func (*InvoiceRowType) SetOtherTaxesAmount

func (i *InvoiceRowType) SetOtherTaxesAmount(amount float64, category mydatavalues.MiscTaxCategoryType) *InvoiceRowType

SetOtherTaxesAmount sets the invoice row's other taxes amount and category.

func (*InvoiceRowType) SetQuantity

func (i *InvoiceRowType) SetQuantity(quantity float64) *InvoiceRowType

SetQuantity sets the invoice row's quantity.

func (*InvoiceRowType) SetRecType

SetRecType sets the invoice row's recType. What type of invoice we have

func (*InvoiceRowType) SetStampAmount

func (i *InvoiceRowType) SetStampAmount(amount float64, category mydatavalues.PaperStampCategoryType) *InvoiceRowType

SetStampAmount sets the invoice row's stamp amount and category.

func (*InvoiceRowType) SetVatExemptionCategory

func (i *InvoiceRowType) SetVatExemptionCategory(category mydatavalues.VATExceptionReasonType) *InvoiceRowType

SetVatExemptionCategory sets the invoice row's vat exemption category.

func (*InvoiceRowType) SetWithheldAmount

func (i *InvoiceRowType) SetWithheldAmount(amount float64, category mydatavalues.WithholdingTaxCategoryType) *InvoiceRowType

SetWithheldAmount sets the invoice row's withheld amount and category.

func (*InvoiceRowType) Validate

func (i *InvoiceRowType) Validate() error

Validate validates the invoice row

type InvoiceSummaryType

type InvoiceSummaryType struct {
	TotalNetValue          float64                       `xml:"totalNetValue"`          // * Σύνολο Καθαρής Αξίας
	TotalVatAmount         float64                       `xml:"totalVatAmount"`         // * Σύνολο ΦΠΑ
	TotalWithheldAmount    float64                       `xml:"totalWithheldAmount"`    // * Σύνολο Παρακράτησης Φόρου
	TotalFeesAmount        float64                       `xml:"totalFeesAmount"`        // * Σύνολο Τελών
	TotalStampDutyAmount   float64                       `xml:"totalStampDutyAmount"`   // * Σύνολο Χαρτοσήμου
	TotalOtherTaxesAmount  float64                       `xml:"totalOtherTaxesAmount"`  // * Σύνολο Λοιπών Φόρων
	TotalDeductionsAmount  float64                       `xml:"totalDeductionsAmount"`  // * Σύνολο Κρατήσεων
	TotalGrossValue        float64                       `xml:"totalGrossValue"`        // * Σύνολο Αξίας
	IncomeClassification   []*IncomeClassificationType   `xml:"incomeClassification"`   // Χαρακτηρισμοί Εσόδων
	ExpensesClassification []*ExpensesClassificationType `xml:"expensesClassification"` // Χαρακτηρισμοί Εξόδων
}

type InvoicesDoc

type InvoicesDoc struct {
	Xmlns     string     `xml:"xmlns,attr"`
	XmlnsICLS string     `xml:"xmlns:icls,attr"`
	XmlnsECLS string     `xml:"xmlns:ecls,attr"`
	Invoices  []*Invoice `xml:"invoice"`
}

func NewInvoices

func NewInvoices() *InvoicesDoc

func (*InvoicesDoc) AddInvoice

func (i *InvoicesDoc) AddInvoice(invoice *Invoice) *InvoicesDoc

AddInvoice adds an invoice to the invoices array

func (*InvoicesDoc) FilterInvalid

func (i *InvoicesDoc) FilterInvalid() *InvoicesDoc

FilterInvalid returns a new invoices doc with only the valid invoices

func (*InvoicesDoc) Validate

func (i *InvoicesDoc) Validate() error

Validate validates the invoices doc. Checks if the invoices array is not empty and validates each invoice

type InvoicesExpensesClassificationDetails

type InvoicesExpensesClassificationDetails struct {
	LineNumber                       int                           `xml:"lineNumber"`                       // Αριθμός Γραμμής Παραστατικού
	ExpensesClassificationDetailData []*ExpensesClassificationType `xml:"expensesClassificationDetailData"` // Στοιχεία Χαρακτηρισμού Εσόδων
}

type InvoicesIncomeClassificationDetails

type InvoicesIncomeClassificationDetails struct {
	LineNumber                     int                         `xml:"lineNumber"`                     // Αριθμός Γραμμής Παραστατικού
	IncomeClassificationDetailData []*IncomeClassificationType `xml:"incomeClassificationDetailData"` // Στοιχεία Χαρακτηρισμού Εσόδων
}

type OtherDeliveryNoteHeaderType

type OtherDeliveryNoteHeaderType struct {
	LoadingAddress         *Address `xml:"loadingAddress"`         // Διεύθυνση φόρτωσης συμπληρώνεται για παραστατικά που είναι δελτία αποστολής ή τιμολόγιο και δελτίο αποστολής
	DeliveryAddress        *Address `xml:"deliveryAddress"`        // Διεύθυνση παράδοσης συμπληρώνεται για παραστατικά που είναι δελτία αποστολής ή τιμολόγιο και δελτίο αποστολής
	StartShippingBranch    *int64   `xml:"startShippingBranch"`    // Αριθμός Υποκαταστήματος Έναρξης Μεταφοράς
	CompleteShippingBranch *int64   `xml:"completeShippingBranch"` // Αριθμός Υποκαταστήματος Ολοκλήρωσης Μεταφοράς
}

type PartyType

type PartyType struct {
	VatNumber         *string  `xml:"vatNumber"`         // * ΑΦΜ
	Country           *string  `xml:"country"`           // * Κωδικός Χώρας (Ελλάδα = GR)
	Branch            *uint64  `xml:"branch"`            // * Αριθμός Υποκαταστήματος. Ελάχιστη τιμή = 0 που είναι η έδρα του εκδότη.
	Name              *string  `xml:"name"`              // Επωνυμία. Τα στοιχεία Επωνυμία και Διεύθυνση δε γίνονται αποδεκτά στην περίπτωση που αφορούν οντότητα εντός Ελλάδας
	Address           *Address `xml:"address"`           // Διεύθυνση
	DocumentIdNo      *string  `xml:"documentIdNo"`      // Αριθμός επίσημου εγγράφου (max 100 chars). Έγκυρο μόνο στην περίπτωση που ο τύπος εγγράφου είναι ο 4
	SupplyAccountNo   *string  `xml:"supplyAccountNo"`   // Αριθμός Παροχής Ηλεκτρικού Ρεύματος (max 100 chars). Έγκυρα μόνο στην περίπτωση παραστατικών καυσίμων
	CountryDocumentId *string  `xml:"countryDocumentId"` // Κωδικός χώρας έκδοσης επίσημου εγγράφου
}

type PaymentMethodDetailsType

type PaymentMethodDetailsType struct {
	Type               *mydatavalues.InvoicePaymentType `xml:"type"`               // Ελάχιστη τιμή = 1 Μέγιστη τιμή = 5
	Amount             *float64                         `xml:"amount"`             // Ελάχιστη τιμή 0. Δεκαδικά ψηφία 2
	PaymentMethodInfo  string                           `xml:"paymentMethodInfo"`  // Πληροφορίες (πχ Αριθμός Τραπέζης)
	TipAmount          *float64                         `xml:"tipAmount"`          // Ποσό φιλοδωρήματος.Ελάχιστη τιμή 0.Δεκαδικά ψηφία 2
	TransactionId      *string                          `xml:"transactionId"`      // Μοναδική ταυτότητα πληρωμής.Διαβιβάζεται στην περίπτωση πληρωμών με type = 7 (POS)
	ProvidersSignature *ProviderSignatureType           `xml:"ProvidersSignature"` // Υπογραφή πληρωμής παρόχου.Διαβιβάζεται στην περίπτωση πληρωμών με type = 7 (POS).Μέσω παρόχου
	ECRToken           *ECRTokenType                    `xml:"ECRToken"`           // Κρυπτογραφημένος κωδικός πληρωμής. Για πληρωμές με type = 7 (POS).Μέσω ERP.
}

type PaymentMethodType

type PaymentMethodType struct {
	InvoiceMark          *int64                    `xml:"invoiceMark"`
	PaymentMethodMark    *int64                    `xml:"paymentMethodMark"`    // Μοναδικός Αριθμός Καταχώρησης Τρόπου Πληρωμής
	EntityVatNumber      *string                   `xml:"entityVatNumber"`      // ΑΦΜ Οντότητας
	PaymentMethodDetails *PaymentMethodDetailsType `xml:"paymentMethodDetails"` // Στοιχεία Τρόπου Πληρωμής
}

type PaymentMethods

type PaymentMethods struct {
	PaymentMethodDetails []PaymentMethodDetailsType `xml:"paymentMethodDetails"`
}

type PaymentMethodsDoc

type PaymentMethodsDoc struct {
	PaymentMethods []*PaymentMethodType `xml:"paymentMethods"`
}

type ProviderSignatureType

type ProviderSignatureType struct {
	SigningAuthor *string `xml:"SigningAuthor"` // Αριθμός Απόφασης έγκρισης ΥΠΑΗΕΣ	Παρόχου (μέγιστο 20 χαρακτήρες)
	Signature     *string `xml:"Signature"`     // Υπογραφή παρόχου (μέγιστο 20 χαρακτήρες).Λεπτομέρειες στην υπ’ αριθμ.Α.1155/09-10-2023 απόφαση ΦΕΚ 5992 Β΄/13.10.2023
}

type RequestDocsParams

type RequestDocsParams struct {
	Mark              string                    // * Μοναδικός αριθμός καταχώρησης
	EntityVatNumber   string                    // ΑΦΜ αναφοράς
	DateFrom          time.Time                 // Αρχή χρονικού διαστήματος αναζήτησης για την ημερομηνία έκδοσης
	DateTo            time.Time                 // Τέλος χρονικού διαστήματος αναζήτησης για την ημερομηνία έκδοσης
	ReceiverVatNumber string                    // ΑΦΜ παραλήπτη
	InvType           *mydatavalues.InvoiceType // Τύπος Παραστατικού
	MaxMark           string                    // Μέγιστος Αριθμός ΜΑΡΚ
	NextPartitionKey  string                    // Παράμετρος για την τμηματική λήψη των αποτελεσμάτων
	NextRowKey        string                    // Παράμετρος για την τμηματική λήψη των αποτελεσμάτων
}

func (*RequestDocsParams) ToMap

func (p *RequestDocsParams) ToMap() (map[string]string, error)

type RequestMyExpensesParams

type RequestMyExpensesParams struct {
	DateFrom         time.Time
	DateTo           time.Time
	CounterVatNumber string                   // ΑΦΜ αντισυμβαλλόμενου
	EntityVatNumber  string                   // ΑΦΜ αναφοράς
	InvType          mydatavalues.InvoiceType // Τύπος Παραστατικού
	NextPartitionKey string                   // Παράμετρος για την τμηματική λήψη των αποτελεσμάτων
	NextRowKey       string                   // Παράμετρος για την τμηματική λήψη των αποτελεσμάτων
}

func (*RequestMyExpensesParams) ToMap

func (p *RequestMyExpensesParams) ToMap() (map[string]string, error)

type RequestMyIncomeParams

type RequestMyIncomeParams struct {
	DateFrom         time.Time
	DateTo           time.Time
	CounterVatNumber string                   // ΑΦΜ αντισυμβαλλόμενου
	EntityVatNumber  string                   // ΑΦΜ αναφοράς
	InvType          mydatavalues.InvoiceType // Τύπος Παραστατικού
	NextPartitionKey string                   // Παράμετρος για την τμηματική λήψη των αποτελεσμάτων
	NextRowKey       string                   // Παράμετρος για την τμηματική λήψη των αποτελεσμάτων
}

func (*RequestMyIncomeParams) ToMap

func (p *RequestMyIncomeParams) ToMap() (map[string]string, error)

type RequestedBookInfo

type RequestedBookInfo struct {
	Xmlns     string     `xml:"xmlns,attr"`
	XmlnsICLS string     `xml:"xmlns:icls,attr"`
	XmlnsECLS string     `xml:"xmlns:ecls,attr"`
	BooksInfo []BookInfo `xml:"bookInfo"`
}

type RequestedDoc

type RequestedDoc struct {
	XMLName                   xml.Name                    `xml:"http://www.aade.gr/myDATA/invoice/v1.0 RequestedDoc"`
	XmlnsICLS                 string                      `xml:"xmlns icls,attr"`
	XmlnsECLS                 string                      `xml:"xmlns ecls,attr"`
	ContinuationToken         *ContinuationToken          `xml:"continuationToken"`
	InvoicesDoc               *InvoicesDoc                `xml:"invoicesDoc"`
	CancelledInvoicesDoc      *CancelledInvoicesDoc       `xml:"cancelledInvoicesDoc"`
	IncomeClassificationDoc   *IncomeClassificationsDoc   `xml:"incomeClassificationsDoc"`
	ExpensesClassificationDoc *ExpensesClassificationsDoc `xml:"expensesClassificationDoc"`
	PaymentMethodsDoc         *PaymentMethodsDoc          `xml:"paymentMethodsDoc"`
}

type Response

type Response struct {
	StatusCode         string `xml:"statusCode"`
	Errors             Errors `xml:"errors"`
	Index              uint   `xml:"index"`
	InvoiceUID         string `xml:"invoiceUid"`
	InvoiceMark        uint64 `xml:"invoiceMark"`
	QrCodeUrl          string `xml:"qrUrl"`
	ClassificationMark uint64 `xml:"classificationMark"`
	AuthenticationCode string `xml:"authenticationCode"`
	CancellationMark   uint64 `xml:"cancellationMark"`
}

func (Response) String

func (r Response) String() string

type ResponseDoc

type ResponseDoc struct {
	Response []*Response `xml:"response"`
}

func (ResponseDoc) Errors

func (rDoc ResponseDoc) Errors(prefix string) error

Errors returns all errors of the response doc wrapped with a given prefix. If no errors are found, then it returns nil.

func (ResponseDoc) HasErrors

func (rDoc ResponseDoc) HasErrors() bool

HasErrors returns true if the response contains at least one errors, else false.

func (ResponseDoc) String

func (rDoc ResponseDoc) String() string

type ShipType

type ShipType struct {
	ApplicationID   string `xml:"applicationId"`   // Αριθμός Δήλωσης Διενέργειας Δραστηριότητας
	ApplicationDate string `xml:"applicationDate"` // Ημερομηνία Δήλωσης
	Doy             string `xml:"doy"`             // ΔΟΥ Δήλωσης
	ShipID          string `xml:"shipID"`          // Στοιχεία Πλοίου
}

type TaxTotalsType

type TaxTotalsType struct {
	Taxes []*Taxes `xml:"taxes"`
}

type Taxes

type Taxes struct {
	TaxType         *mydatavalues.TaxType `xml:"taxType"`         // Είδος Φόρου
	TaxCategory     *uint                 `xml:"taxCategory"`     // Κατηγορία Φόρου
	UnderlyingValue *float64              `xml:"underlyingValue"` // Υποκείμενη Αξία (την αξία στην οποία εφαρμόζεται ο συγκεκριμένος φόρος)
	TaxAmount       *float64              `xml:"taxAmount"`       // Ποσό Φόρου
	ID              *byte                 `xml:"id"`              // Αύξων αριθμός γραμμής
}

type TransportDetailType

type TransportDetailType struct {
	VehicleNumber string `xml:"vehicleNumber"` // * Αριθμός οχήματος (max 50 chars)
}

Jump to

Keyboard shortcuts

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