financials

package
v0.0.0-2429 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const EUR = Currency("EUR")
View Source
const FinancialEntityIDTypeCREDIT_NOTE = FinancialEntityIDType("CREDIT_NOTE")
View Source
const FinancialEntityIDTypeFINANCE_ACCOUNT = FinancialEntityIDType("FINANCE_ACCOUNT")
View Source
const FinancialEntityIDTypeINVOICE = FinancialEntityIDType("INVOICE")
View Source
const FinancialEntityIDTypePAYMENT = FinancialEntityIDType("PAYMENT")
View Source
const FinancialEntityIDTypePURCHASE_CREDIT_NOTE = FinancialEntityIDType("PURCHASE_CREDIT_NOTE")
View Source
const FinancialEntityIDTypePURCHASE_INVOICE = FinancialEntityIDType("PURCHASE_INVOICE")
View Source
const FinancialEntityIDTypeREFUND = FinancialEntityIDType("REFUND")
View Source
const FinancialEntityIdExportStatusCREATED = FinancialIdentifierExportStatus("CREATED")
View Source
const FinancialEntityIdExportStatusEXPORTED = FinancialIdentifierExportStatus("EXPORTED")
View Source
const FinancialEntityIdExportStatusFAILED = FinancialIdentifierExportStatus("FAILED")
View Source
const FinancialEntityIdExportStatusIMPORTED = FinancialIdentifierExportStatus("IMPORTED")
View Source
const FinancialEntityIdExportStatusPENDING = FinancialIdentifierExportStatus("PENDING")
View Source
const FinancialEntityIdExportStatusSENT = FinancialIdentifierExportStatus("SENT")
View Source
const FinancialEntityIdExportStatusSKIPPED = FinancialIdentifierExportStatus("SKIPPED")
View Source
const FinancyAccountTypeCompany = FinanceAccountType("COMPANY")
View Source
const FinancyAccountTypeContact = FinanceAccountType("CONTACT")
View Source
const GBP = Currency("GBP")
View Source
const HKD = Currency("HKD")
View Source
const SEK = Currency("SEK")
View Source
const USD = Currency("USD")

Variables

This section is empty.

Functions

This section is empty.

Types

type Currency

type Currency string

type FinanceAccount

type FinanceAccount struct {
	Type          FinanceAccountType         `json:"type"`
	AccountNumber string                     `json:"accountNumber"`
	ID            *FinancialEntityIdentifier `json:"id"`
	Email         string                     `json:"emailAddress"`
	AccountName   string                     `json:"accountName"`
}

type FinanceAccountType

type FinanceAccountType string

type FinancialEntityID

type FinancialEntityID struct {
	Type         FinancialEntityIDType           `json:"type"`
	ID           FinancialEntityIDID             `json:"id"`
	ExternalID   string                          `json:"externalId"`
	ExportStatus FinancialIdentifierExportStatus `json:"exportStatus"`

	// ExportDate $date-time
	ExportDate string `json:"exportDate"`
}

type FinancialEntityIDID

type FinancialEntityIDID int

type FinancialEntityIDType

type FinancialEntityIDType string

type FinancialEntityIdentifier

type FinancialEntityIdentifier struct {
}

type FinancialIdentifierExportStatus

type FinancialIdentifierExportStatus string

type FinancialsClient

type FinancialsClient interface {
	ListInvoices(period utils.BookingPeriod, org resharmonics.OrganizationID, pagination *utils.Pagination) ([]*Invoice, error)
	GetInvoice(invoiceID FinancialEntityIDID) (*Invoice, error)
}

func Init

func Init(creds resharmonics.Credentials, preAuthorize bool) (FinancialsClient, error)

type Invoice

type Invoice struct {
	FinanceAccount *FinanceAccount `json:"financeAccount"`
	// Number is unique
	Number   InvoiceNumber      `json:"invoiceNumber"`
	ID       *FinancialEntityID `json:"id"`
	TotalNet float64            `json:"totalNet"`
	TotalVat float64            `json:"totalTax"`
	Currency Currency           `json:"currencyCode"`

	// InvoiceDate $date, no time
	InvoiceDate string `json:"invoiceDate"`

	InvoiceDueDate string `json:"invoiceDueDate"`

	InvoiceReference string     `json:"invoiceReference,omitempty"`
	Items            []LineItem `json:"lineItems"`
}

func (*Invoice) ExtractID

func (inv *Invoice) ExtractID() FinancialEntityIDID

func (*Invoice) Validate

func (inv *Invoice) Validate() error

type InvoiceDetails

type InvoiceDetails struct {
	CustomerName string            `json:"customerName"`
	CompanyName  string            `json:"companyName"`
	Address      *property.Address `json:"address"`
}

type InvoiceNumber

type InvoiceNumber string

type ItemCode

type ItemCode string

type ItemID

type ItemID int

type LineItem

type LineItem struct {
	ID          ItemID `json:"itemId"`
	Description string `json:"description"`

	// Code a code that references the product that this line item corresponds to
	Code ItemCode `json:"itemCode"`

	// TaxType a mapping element used to specify the tax code used for this line item
	TaxType     string       `json:"taxType"`
	ProductID   product.ID   `json:"productId"`
	ProductCode product.Code `json:"productCode"`

	Quantity     float64 `json:"quantity"`
	UnitPriceNet float64 `json:"unitPriceNet"`
	TotalNet     float64 `json:"totalNet"`
	TotalTax     float64 `json:"totalTax"`

	CostCenter string `json:"costCenter"`

	UnitReference string `json:"unitReference"`

	BookingReference resharmonics.BookingReference `json:"bookingReference"`

	// ChargeFrom $date
	ChargeFrom string `json:"chargeFrom"`

	// ChargeTo $date
	ChargeTo string `json:"chargeTo"`
}

type ListInvoicesResponse

type ListInvoicesResponse struct {
	Invoices []*Invoice `json:"invoices"`
}

Jump to

Keyboard shortcuts

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