ui

package
v0.0.0-...-c907a8e Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CorporateTax

type CorporateTax struct {
	Period                   string
	StartingDate             time.Time
	EndingDate               time.Time
	NextPaymentDate          time.Time
	CorporateTaxSoFar        float64
	EarnedAccountingPeriod   float64
	ExpensesAccountingPeriod float64
	PensionAccountingPeriod  float64
}

struct that keeps all the data for the dashboard

type DashboardData

type DashboardData struct {
	GetTransactions              FnLoadTransactions
	TotalTransactionsCnt         int
	PreviousPeriod               CorporateTax
	CurrentPeriod                CorporateTax
	PreviousSelfAssessmentPeriod SelfAssessmentTax
	CurrentSelfAssessmentPeriod  SelfAssessmentTax
	PreviousVAT                  VAT
	CurrentVAT                   VAT
	Loans                        DirectorLoans
}

struct that keeps all the data for the dashboard

func CollectDataForDashboard

func CollectDataForDashboard(d *db.Database, accountingDateStart time.Time, vatMonth time.Month) (*DashboardData, error)

CollectDataForDashboard accountingDateStart is only day and month, like 01-11

type DirectorLoans

type DirectorLoans struct {
	Transactions       []db.Transaction
	LeftForActiveLoan  float64
	LoanMustBeReturnBy time.Time
}

struct that keeps all the data for the dashboard

type FnLoadTransactions

type FnLoadTransactions func(limit, page int) []db.Transaction

struct that keeps all the data for the dashboard

type FuncAllocateTransactions

type FuncAllocateTransactions func(txToAllocate map[int]db.TransactionCategory) error

callback function that will be fired on the Save button clicking

type PageableTransactions

type PageableTransactions struct {
	// contains filtered or unexported fields
}

func BuildTxTable

func BuildTxTable(a *tview.Application, totalTransactionsCnt int, fnLoadTransactions FnLoadTransactions) *PageableTransactions

func (*PageableTransactions) Draw

func (p *PageableTransactions) Draw() *tview.Flex

type SelfAssessmentTax

type SelfAssessmentTax struct {
	StartingDate             time.Time
	EndingDate               time.Time
	NextPaymentDate          time.Time
	MovedOutFromCompanyTotal float64
	SelfAssessmentTaxSoFar   float64
	TaxRate                  tax.Rate
	// warning:
	HowMuchBeforeNextThreshold float64

	IsWarning bool
}

TODO: Salary, dividends?

type TerminalUI

type TerminalUI struct {
	// contains filtered or unexported fields
}

func (*TerminalUI) BeginDialogToAllocateTransactions

func (t *TerminalUI) BeginDialogToAllocateTransactions(unallocatedTxs []db.Transaction, fnAllocate FuncAllocateTransactions)

func (*TerminalUI) DrawDashboard

func (t *TerminalUI) DrawDashboard(data *DashboardData)

func (*TerminalUI) Start

func (t *TerminalUI) Start()

type UI

type UI interface {
	Start()
	BeginDialogToAllocateTransactions(unallocatedTxs []db.Transaction, fnAllocate FuncAllocateTransactions)
	ShowDashboard(data DashboardData)
}

UI is a common interface for an GUI. At this moment we have only terminal UI, but if in the future we will need to do another UI, it would be easy possible to do by implementing this interface

type VAT

type VAT struct {
	Since                   time.Time
	Until                   time.Time
	NextVATToBePaidSoFar    float64
	NextDateYouShouldPayFor time.Time
	NextMonthSubmit         string
}

struct that keeps all the data for the dashboard

Jump to

Keyboard shortcuts

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