check ledger output a little bit
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -60,7 +61,10 @@ func uploadLedger(config Config, transaction *Transaction) error {
|
||||
if amount > 0 {
|
||||
remote = "Deposit:"
|
||||
}
|
||||
remote += strings.ReplaceAll(transaction.Vendor, " ", "")
|
||||
regexp := regexp.MustCompile(`[0-9a-zA-Z]`)
|
||||
for _, substr := range regexp.FindAllString(transaction.Vendor, -1) {
|
||||
remote += substr
|
||||
}
|
||||
fmt.Fprintf(f, "%-50s%-s\n", formatGMailDate(transaction.Date), transaction.Vendor)
|
||||
fmt.Fprintf(f, "%-50s%-50s$%.2f\n", "", "AssetAccount:"+transaction.Bank.String(), amount)
|
||||
fmt.Fprintf(f, "%-50s%-s\n", "", remote)
|
||||
|
||||
Reference in New Issue
Block a user