tax

package
v0.241024.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: CC0-1.0 Imports: 25 Imported by: 0

Documentation

Overview

Sends tax information to state. Executes tax_job queue in DB.

Index

Constants

View Source
const CmdName = "tax"

Variables

View Source
var CashLess struct {
	Alive *alive.Alive
	// contains filtered or unexported fields
}
View Source
var Cmd = cli.Cmd{
	Name:   CmdName,
	Desc:   "execute tax jobs",
	Action: taxMain,
}

Functions

func CashLessErrorDB

func CashLessErrorDB(format string, args ...interface{})

func CashLessInit

func CashLessInit(ctx context.Context)

func CashLessStop

func CashLessStop()

func MakeQr

func MakeQr(ctx context.Context, vmid int32, rm *tele.FromRoboMessage)

Types

type CashLessOrderStruct

type CashLessOrderStruct struct {
	Order_state   orderState
	Vmid          int32
	Payment_id    string
	Paymentid     uint64
	Order_id      string
	Amount        uint64
	Payer         string
	Create_date   time.Time
	Description   string
	ToRoboMessage *tele.ToRoboMessage
}

type MTaxJob

type MTaxJob struct {
	Id        int64 `pg:",pk"`
	State     string
	Created   time.Time
	Modified  time.Time
	Scheduled time.Time
	Worker    string
	Processor string
	ExtId     string
	Ops       []TaxJobOp `pg:"ops"`
	Data      *TaxJobData
	Notes     []string `pg:",array"`
	Gross     int32
}

func (*MTaxJob) OpKeysString

func (tj *MTaxJob) OpKeysString() string

func (*MTaxJob) Update

func (tj *MTaxJob) Update(conn *pg.Conn, assign string, params ...interface{}) error

func (*MTaxJob) UpdateFinal

func (tj *MTaxJob) UpdateFinal(conn *pg.Conn, note string) error

func (*MTaxJob) UpdateScheduleLater

func (tj *MTaxJob) UpdateScheduleLater(conn *pg.Conn) error

type TaxJobData

type TaxJobData struct {
	Ru2019 struct {
		OpTime  string `json:"optime,omitempty"`
		DocNum  uint32 `json:"docnum,omitempty"`
		DocType uint16 `json:"doctype,omitempty"`

		FSStatus struct {
			FSNum            string `json:"fsnum,omitempty"`
			CycleOpen        bool   `json:"cycle_open,omitempty"`
			LastDocNumber    uint32 `json:"last_doc,omitempty"`
			UnsentDocNumber  uint32 `json:"unsent_doc,omitempty"`
			OfflineDocsCount uint32 `json:"offline_docs,omitempty"`
		} `json:"fss,omitempty"`
	} `json:"ru2019,omitempty"`
}

func (*TaxJobData) String

func (d *TaxJobData) String() string

type TaxJobOp

type TaxJobOp struct {
	Time   string  `json:"time"`
	Name   string  `json:"name"`
	Code   string  `json:"code"`
	Amount float64 `json:"amount"`
	Price  uint32  `json:"price"`
	Vmid   int32   `json:"vmid"`

	Method vender_api.PaymentMethod `json:"method"`
}

func (*TaxJobOp) KeyString

func (o *TaxJobOp) KeyString() string

Jump to

Keyboard shortcuts

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