summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2020-11-09 02:49:21 +0100
committerNikolaus Gotsche <n@softwarefools.com>2020-11-09 02:49:21 +0100
commit86c22853ee70e74954c652ba34dd0d499de50e54 (patch)
treee110a6a3ead2882ec768c2d568b81e96d1efbae1 /config.go
parent1f9dcb69b80d7a7b9211b106bfa130e125545f7c (diff)
UstIDs for Customers and Owner, Tax Rate implemented0.5.0
Diffstat (limited to 'config.go')
-rw-r--r--config.go20
1 files changed, 17 insertions, 3 deletions
diff --git a/config.go b/config.go
index 944bd45..5f84da1 100644
--- a/config.go
+++ b/config.go
@@ -5,7 +5,7 @@ import (
"fmt"
//"os"
"io/ioutil"
- //"strconv"
+ "strconv"
"github.com/BurntSushi/toml"
"github.com/atrox/homedir"
"github.com/fatih/color"
@@ -25,11 +25,13 @@ type Config struct {
Mail string //`toml:"mail"`
Url string //`toml:"url"`
Taxid string //`toml:"taxid"`
+ Uid string //`toml:"uid"`
Bankacc string //`toml:"bankacc"`
Banklz string //`toml:"banklz"`
Bankname string //`toml:"bankname"`
Iban string //`toml:"iban"`
Bic string //`toml:"bic"`
+ Ust float64 //`toml:"ust"`
}
var conffile string
@@ -87,7 +89,7 @@ func makeNewTOML(gibts bool) {
n := ""
file, err := homedir.Expand("~/.mywork.db")
checkErr(err)
- config = Config{file, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n}
+ config = Config{file, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n,0.0}
}
//fmt.Println("Whats Your Namecount\n")
database := getNewInterInput("DB File Path: ", config.Database, nli)
@@ -103,13 +105,25 @@ func makeNewTOML(gibts bool) {
mail := getNewInterInput("Email: ", config.Mail, nli)
url := getNewInterInput("URL: ", config.Url, nli)
taxid := getNewInterInput("Tax ID: ", config.Taxid, nli)
+ uid := getNewInterInput("UID: ", config.Uid, nli)
+ var ust float64
+ for{
+ uststr := getNewInterInput("USt %: ", fmt.Sprint(config.Ust), nli)
+ ust, err = strconv.ParseFloat(uststr, 64)
+ if err != nil {
+ //fmt.Println(nli,uststr, boldRed("can not be Parsed as a Float."), "Try a sh ape of X.X")
+ fmt.Println(nli,uststr, "can not be Parsed as a Float.", "Try a sh ape of X.X")
+ } else {
+ break
+ }
+ }
bankname := getNewInterInput("Bank Name: ", config.Bankname, nli)
bankacc := getNewInterInput("Bank Account: ", config.Bankacc, nli)
banklz := getNewInterInput("BLZ: ", config.Banklz, nli)
iban := getNewInterInput("IBAN: ", config.Iban, nli)
bic := getNewInterInput("BIC: ", config.Bic, nli)
- conf := Config{database, folder, prefix, name, street, zip, city, country, telefon, mobile, mail, url, taxid, bankacc, banklz, bankname, iban, bic}
+ conf := Config{database, folder, prefix, name, street, zip, city, country, telefon, mobile, mail, url, taxid, uid, bankacc, banklz, bankname, iban, bic, ust}
buf := new(bytes.Buffer)
err = toml.NewEncoder(buf).Encode(conf)