Commit 57f1650a authored by Morbi's avatar Morbi

into the rabbit hole

parent 0f6fcca2
......@@ -2,13 +2,14 @@ package main
import (
"fmt"
"math/big"
_ "github.com/davecgh/go-spew/spew"
_ "github.com/kr/pretty"
"github.com/davecgh/go-spew/spew"
"github.com/kr/pretty"
"github.com/spf13/cobra"
"github.com/umsatz/go-aqbanking"
_ "gitlab.techcultivation.org/sangha/mq"
"gitlab.techcultivation.org/sangha/mq"
"gitlab.techcultivation.org/sangha/sangha/config"
)
......@@ -104,7 +105,27 @@ func executeFetch() error {
}
for _, transaction := range transactions {
fmt.Printf("transaction: %+v\n", transaction)
valuei, _ := big.NewFloat(float64(transaction.Total) * 100.0).Int64()
spew.Dump(transaction)
t := mq.Payment{
Name: transaction.RemoteName,
DateTime: transaction.ValutaDate,
Amount: valuei,
Currency: transaction.TotalCurrency,
Description: transaction.Purpose,
Source: "hbci",
SourcePayerID: transaction.RemoteIBAN,
}
pretty.Println(t)
err = t.Process()
if err != nil {
panic(err)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment