complete first version of new_year
This commit is contained in:
parent
46e3dccd2a
commit
cd8bf76983
|
|
@ -702,6 +702,25 @@ func outputJournal() {
|
|||
}
|
||||
}
|
||||
|
||||
func outputNewYear() {
|
||||
var active_accounts []string
|
||||
for k := range account_balance {
|
||||
active_accounts = append(active_accounts, k)
|
||||
}
|
||||
sort.Strings(active_accounts)
|
||||
for _, myaccount := range active_accounts {
|
||||
// only Assets or Liabilities
|
||||
at := accountType(myaccount)
|
||||
amountString := fmt.Sprintf("%.2f", account_balance[myaccount].balance_end+avoidMinusZero)
|
||||
if at == "A" || at == "L" {
|
||||
if amountString != "0.00" {
|
||||
fmt.Printf("%s: %.2f\n", myaccount, account_balance[myaccount].balance_end)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintf(os.Stderr, "usage: bookkeeper <action> <accounts file> <transactions file>\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
|
|
@ -736,6 +755,7 @@ func main() {
|
|||
outputMwst(action)
|
||||
case "new_year":
|
||||
fmt.Fprintln(os.Stderr, "INFO: Create New Year")
|
||||
outputNewYear()
|
||||
default:
|
||||
usage()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue