ru_nalog

package module
v0.220727.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: CC0-1.0 Imports: 5 Imported by: 0

README

English

Go library implementing API for Russian electronic tax senders.

Что

Go библиотека для работы с онлайн-кассами Умка.

Целевая аудитория - автоматические платежи (онлайн, вендинг).

Патчи с поддержкой других протоколов (Атолл, DTO) приветствуются.

Пожалуйста, пишите по любым вопросам:

Статус

Готово:

  • генератор Go типов для реквизитов ФД из документа с www.nalog.ru
  • HTTP API Мещера/Умка: cashboxstatus (состояние кассы), fiscaldoc (запрос документа), fiscalcheck (создание чека), открытие/закрытие смены

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataKind

type DataKind uint

kinds of TLV.value

const (
	DataKindInvalid DataKind = iota
	DataKindSTLV
	DataKindBool
	DataKindUint
	DataKindVLN
	DataKindFVLN
	DataKindTime
	DataKindString
	DataKindBytes
)

func (DataKind) String

func (i DataKind) String() string

type Doc

type Doc struct {
	Number    uint32 `fdn:"1040"`
	Type      DocType
	MoneyType int //ТИП ОПЛАТЫ (1. Наличным, 2. Электронными, 3. Предоплата, 4. Постоплата
	Props     TLV
}

func NewDoc

func NewDoc(number uint32, dtype DocType) *Doc

func (*Doc) AppendNew

func (d *Doc) AppendNew(tag Tag, value interface{}) *TLV

func (*Doc) FindByTag

func (d *Doc) FindByTag(tag Tag) *TLV

func (*Doc) String

func (d *Doc) String() string

type DocType

type DocType uint16
const (
	FDRegistration         DocType = 1
	FDRegChange            DocType = 11
	FDCycleOpen            DocType = 2
	FDStateReport          DocType = 21
	FDCheck                DocType = 3
	FDCorrectionCheck      DocType = 31
	FDBSO                  DocType = 4
	FDCorrectionBSO        DocType = 41
	FDCycleClose           DocType = 5
	FDStorageClose         DocType = 6
	FDOperatorConfirmation DocType = 7
)

type FindByTager

type FindByTager interface {
	FindByTag(Tag) *TLV
}

type TLV

type TLV struct {
	TagDesc
	Caption   string
	Printable string
	// contains filtered or unexported fields
}

func NewTLV

func NewTLV(tag Tag) *TLV

func (*TLV) Append

func (self *TLV) Append(n *TLV) *TLV

func (*TLV) AppendNew

func (self *TLV) AppendNew(tag Tag, value interface{}) *TLV

func (*TLV) Bool

func (self *TLV) Bool() bool

func (*TLV) Bytes

func (self *TLV) Bytes() []byte

func (*TLV) Children

func (self *TLV) Children() []TLV

func (*TLV) Err

func (self *TLV) Err() error

func (*TLV) FindByTag

func (self *TLV) FindByTag(tag Tag) *TLV

func (*TLV) FixedString

func (self *TLV) FixedString() string

func (*TLV) Float64

func (self *TLV) Float64() float64

func (*TLV) GoString

func (self *TLV) GoString() string

func (*TLV) SetValue

func (self *TLV) SetValue(value interface{})

func (*TLV) String

func (self *TLV) String() string

func (*TLV) Time

func (self *TLV) Time() time.Time

func (*TLV) Uint32

func (self *TLV) Uint32() uint32

func (*TLV) Uint64

func (self *TLV) Uint64() uint64

VLN / byte[] bug

func (*TLV) Value

func (self *TLV) Value() interface{}

type Tag

type Tag uint16

type TagDesc

type TagDesc struct {
	Kind   DataKind
	Tag    Tag
	Length uint16
	Varlen bool
}

func FindTag

func FindTag(tag Tag) *TagDesc

Searches in user tags (RegisterTags) first, then in builtin tags. Not thread-safe.

func RegisterTags

func RegisterTags(ts []TagDesc) (prev []TagDesc)

Will stable sort argument, return previous value. Not thread-safe.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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