Documentation
¶
Index ¶
- type AccountYearly
- type AssetsWidget
- type BalanceWidget
- type BankWidget
- type FinanceLine
- type FinanceWidget
- type Ledger
- func (self *Ledger) AddMovement(ev LedgerMovement)
- func (self *Ledger) AddSubscriber(sub LedgerSubscriber)
- func (self *Ledger) AskLoan(desc string, t time.Time, amount float64)
- func (self *Ledger) BuyProduct(desc string, t time.Time, price float64)
- func (self *Ledger) GetCurrentDebt(currentyear int) float64
- func (self *Ledger) GetMaximumPossibleDdebt(currentyear int) float64
- func (self *Ledger) GetYearAccount(year int) AccountYearly
- func (self *Ledger) Load(game map[string]interface{}, taxrate, loanrate float64)
- func (self *Ledger) PayLandlord(metersquare int32, price float64, t time.Time)
- func (self *Ledger) PayMapUpgrade(price float64, t time.Time)
- func (self *Ledger) PayServerRenting(price float64, t time.Time, desc string)
- func (self *Ledger) PayUtility(price float64, t time.Time)
- func (self *Ledger) RefundLoan(desc string, t time.Time, amount float64)
- func (self *Ledger) RemoveSubscriber(subscriber LedgerSubscriber)
- func (self *Ledger) Save() string
- type LedgerMovement
- type LedgerSubscriber
- type LiabilitiesWidget
- type MainAccountingWidget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountYearly ¶
type AssetsWidget ¶
type AssetsWidget struct {
FinanceWidget
// contains filtered or unexported fields
}
ACTIF (année N)
Terrain (2312) installation techniques (2315) autre immo (37) - amortissements (28) = actif immobilisé Disponibilité (51) = actif circulant
Total=
func NewAssetsWidget ¶
func NewAssetsWidget() *AssetsWidget
func (*AssetsWidget) LedgerChange ¶
func (self *AssetsWidget) LedgerChange()
type BalanceWidget ¶
type BalanceWidget struct {
FinanceWidget
// contains filtered or unexported fields
}
Balance Sheet:
Comptes de produits (70)
- Comptes de charges (6x sauf 66) = resultat d'exploitation (EBITDA) - amortissement (28) - depreciation (29) = (EBIT) - interet de dettes (66) = resultat courant avant impots (EBT) - taxes sur les benefices (44 (en fait 444)) = benefices/resultat net
func NewBalanceWidget ¶
func NewBalanceWidget() *BalanceWidget
func (*BalanceWidget) LedgerChange ¶
func (self *BalanceWidget) LedgerChange()
type BankWidget ¶
type BankWidget struct {
sws.CoreWidget
// contains filtered or unexported fields
}
Page Shop
func NewBankWidget ¶
func NewBankWidget(root *sws.RootWidget) *BankWidget
func (*BankWidget) LedgerChange ¶
func (self *BankWidget) LedgerChange()
type FinanceLine ¶
type FinanceLine struct {
Title *sws.LabelWidget
N *sws.LabelWidget
N1 *sws.LabelWidget
}
type FinanceWidget ¶
type FinanceWidget struct {
sws.CoreWidget
// contains filtered or unexported fields
}
base widget for all finance sheet widgets
func NewFinanceWidget ¶
func NewFinanceWidget() *FinanceWidget
type Ledger ¶
Ledger
func NewLedger ¶
NewLedger create a global accounting ledger: - taxrate are in percent per year (for example 0.15) - loanrate are in percent per year (for example 0.03)
func (*Ledger) AddMovement ¶
func (self *Ledger) AddMovement(ev LedgerMovement)
func (*Ledger) AddSubscriber ¶
func (self *Ledger) AddSubscriber(sub LedgerSubscriber)
func (*Ledger) AskLoan ¶
161 (capital/debt) -> 5121 (current bank account) every year (every month?) interest rate: 5121 -> 46 (fictious bank account for interest)
func (*Ledger) BuyProduct ¶
607 -> 2315 : product 404 -> 2315 : product et 5121 -> 4011 : money 2315 -> 2815 : amortization
func (*Ledger) GetCurrentDebt ¶
func (*Ledger) GetMaximumPossibleDdebt ¶
GetMaximumPossibleLoan return the maximum loan possible without consideration of the current loan. I take a maximum rate of debt/EBITDA = 4 (not sure it is the best ratio) cf https://www.investopedia.com/terms/d/debt_edbitda.asp
Other references: - http://endettement.org/taux-dendettement-maximum-entreprise/ - https://www.investopedia.com/articles/investing/050115/free-cash-flow-vs-ebitda-which-should-you-analyze.asp - https://en.wikipedia.org/wiki/Free_cash_flow
func (*Ledger) GetYearAccount ¶
func (self *Ledger) GetYearAccount(year int) AccountYearly
func (*Ledger) PayLandlord ¶
func (*Ledger) PayServerRenting ¶
When a customer pay its monthly fee
func (*Ledger) RefundLoan ¶
5121 (current bank account) -> 161 (capital/debt)
func (*Ledger) RemoveSubscriber ¶
func (self *Ledger) RemoveSubscriber(subscriber LedgerSubscriber)
type LedgerMovement ¶
type LedgerMovement struct {
Id int32 // filled by Ledger.AddMovement
Description string
Amount float64
AccountFrom string // from credit
AccountTo string // to debit
Date time.Time
}
payable or reception of money (depending of the sign of Amount
type LedgerSubscriber ¶
type LedgerSubscriber interface {
LedgerChange()
}
object interest to know the ledger status in particular the bank account essential the Dock
type LiabilitiesWidget ¶
type LiabilitiesWidget struct {
FinanceWidget
// contains filtered or unexported fields
}
PASSIF (année N)
capitaux propre (45) + debt interest payed (46) resultat de l'exercice ?? dettes (16) = passif
func NewLiabilitiesWidget ¶
func NewLiabilitiesWidget() *LiabilitiesWidget
func (*LiabilitiesWidget) LedgerChange ¶
func (self *LiabilitiesWidget) LedgerChange()
type MainAccountingWidget ¶
type MainAccountingWidget struct {
// contains filtered or unexported fields
}
func NewMainAccountingWidget ¶
func NewMainAccountingWidget(root *sws.RootWidget) *MainAccountingWidget
func (*MainAccountingWidget) Hide ¶
func (self *MainAccountingWidget) Hide()
func (*MainAccountingWidget) SetGame ¶
func (self *MainAccountingWidget) SetGame(timer *timer.GameTimer, ledger *Ledger)
func (*MainAccountingWidget) Show ¶
func (self *MainAccountingWidget) Show()