diff --git a/postgres/ynab-import.go b/postgres/ynab-import.go index f7c1d61..a0b6481 100644 --- a/postgres/ynab-import.go +++ b/postgres/ynab-import.go @@ -243,7 +243,12 @@ func (ynab *YNABImport) ImportTransactions(r io.Reader) error { } for _, openTransfer := range openTransfers { - fmt.Printf("Found transfer from %s to %s on %s over %f\n", openTransfer.FromAccount, openTransfer.ToAccount, openTransfer.Date, openTransfer.Amount.GetFloat64()) + fmt.Printf("Saving unmatched transfer from %s to %s on %s over %f as regular transaction\n", openTransfer.FromAccount, openTransfer.ToAccount, openTransfer.Date, openTransfer.Amount.GetFloat64()) + _, err = ynab.queries.CreateTransaction(ynab.Context, openTransfer.CreateTransactionParams) + if err != nil { + return fmt.Errorf("could not save transaction %v: %w", openTransfer.CreateTransactionParams, err) + } + } fmt.Printf("Imported %d transactions\n", count)