snippets

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package snippets provides helpers to generate GOBL document snippets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(schema string, data []byte) any

Parse reads in the data and returns a snippet object that is appropriate for the schema. This is assumed to be used in non-essential scenarios, so there is no error handling.

Types

type BillInvoice

type BillInvoice struct {
	// Key invoice header fields
	UUID            uuid.UUID     `json:"uuid,omitempty"`
	Type            string        `json:"type"`
	Series          string        `json:"series,omitempty"`
	Code            string        `json:"code"`
	Currency        currency.Code `json:"currency"`
	IssueDate       cal.Date      `json:"issue_date"`
	Supplier        *OrgParty     `json:"supplier,omitempty"`
	Customer        *OrgParty     `json:"customer,omitempty"`
	Total           *num.Amount   `json:"total,omitempty"`
	Tax             *num.Amount   `json:"tax,omitempty"`
	TotalWithTax    *num.Amount   `json:"total_with_tax,omitempty"`
	Payable         *num.Amount   `json:"payable,omitempty"`
	PrecedingSeries string        `json:"p_series,omitempty"`
	PrecedingCode   string        `json:"p_code,omitempty"`
	PrecedingUUID   uuid.UUID     `json:"p_uuid,omitempty"`
}

BillInvoice contains the summary details of an invoice.

type NoteMessage

type NoteMessage struct {
	UUID  string `json:"uuid,omitempty"`
	Title string `json:"title"`
}

NoteMessage contains the minimum snippet details of a message.

type OrgParty

type OrgParty struct {
	UUID    uuid.UUID           `json:"uuid,omitempty"`
	Name    string              `json:"name"`
	Alias   string              `json:"alias,omitempty"`
	Country l10n.TaxCountryCode `json:"country,omitempty"`
	TaxCode string              `json:"tax_code,omitempty"`
}

OrgParty contains a snippet of the data for an org party.

Jump to

Keyboard shortcuts

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